public ODataExceptionWrapper(final UriInfo uriInfo, final HttpHeaders httpHeaders, final ODataErrorCallback errorCallback) { contentType = getContentType(uriInfo, httpHeaders).toContentTypeString(); messageLocale = MessageService.getSupportedLocale(getLanguages(httpHeaders), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = httpHeaders.getRequestHeaders(); requestUri = uriInfo.getRequestUri(); callback = errorCallback; }
public ODataExceptionWrapper(final UriInfo uriInfo, final HttpHeaders httpHeaders, final ODataErrorCallback errorCallback) { try { contentType = getContentType(uriInfo, httpHeaders).toContentTypeString(); requestUri = uriInfo != null ? uriInfo.getRequestUri() : null; } catch (IllegalArgumentException e) { contentType = null; requestUri = null; } messageLocale = MessageService.getSupportedLocale(getLanguages(httpHeaders), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = httpHeaders.getRequestHeaders(); callback = errorCallback; }
public ODataExceptionWrapper(final UriInfo uriInfo, final HttpHeaders httpHeaders, final ODataErrorCallback errorCallback) { try { contentType = getContentType(uriInfo, httpHeaders).toContentTypeString(); requestUri = uriInfo != null ? uriInfo.getRequestUri() : null; } catch (IllegalArgumentException e) { contentType = null; requestUri = null; } messageLocale = MessageService.getSupportedLocale(getLanguages(httpHeaders), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = httpHeaders.getRequestHeaders(); callback = errorCallback; }
public ODataExceptionWrapper(final ODataContext context, final Map<String, String> queryParameters, final List<String> acceptHeaderContentTypes) { contentType = getContentType(queryParameters, acceptHeaderContentTypes).toContentTypeString(); messageLocale = MessageService.getSupportedLocale(getLanguages(context), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = context.getRequestHeaders(); try { requestUri = context.getPathInfo().getRequestUri(); errorContext.setPathInfo(context.getPathInfo()); callback = getErrorHandlerCallbackFromContext(context); } catch (Exception e) { throw new ODataRuntimeException("Exception occurred", e); } }
public ODataExceptionWrapper(final ODataContext context, final Map<String, String> queryParameters, final List<String> acceptHeaderContentTypes) { contentType = getContentType(queryParameters, acceptHeaderContentTypes).toContentTypeString(); messageLocale = MessageService.getSupportedLocale(getLanguages(context), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = context.getRequestHeaders(); try { requestUri = context.getPathInfo().getRequestUri(); errorContext.setPathInfo(context.getPathInfo()); callback = getErrorHandlerCallbackFromContext(context); } catch (Exception e) { throw new ODataRuntimeException("Exception occurred", e); } }
public ODataExceptionWrapper(final ODataContext context, final Map<String, String> queryParameters, final List<String> acceptHeaderContentTypes) { contentType = getContentType(queryParameters, acceptHeaderContentTypes).toContentTypeString(); messageLocale = MessageService.getSupportedLocale(getLanguages(context), DEFAULT_RESPONSE_LOCALE); httpRequestHeaders = context.getRequestHeaders(); try { requestUri = context.getPathInfo().getRequestUri(); errorContext.setPathInfo(context.getPathInfo()); callback = getErrorHandlerCallbackFromContext(context); } catch (Exception e) { throw new ODataRuntimeException("Exception occurred", e); } }