Examples of ODataExceptionWrapper


Examples of org.apache.olingo.odata2.core.ODataExceptionWrapper

    ODataContextImpl context = new ODataContextImpl(request, serviceFactory);
    context.setRequest(request);
    context.setAcceptableLanguages(request.getAcceptableLanguages());
    context.setPathInfo(request.getPathInfo());
    context.setServiceFactory(serviceFactory);
    ODataExceptionWrapper exceptionWrapper =
        new ODataExceptionWrapper(context, request.getQueryParameters(), request.getAcceptHeaders());
    ODataResponse response =
        exceptionWrapper.wrapInExceptionResponse(new ODataNotImplementedException(messageReference));
    return RestUtil.convertResponse(response);
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.ODataExceptionWrapper

    // Convert OData response to JAX-RS response.
    return RestUtil.convertResponse(response);
  }

  private ODataResponse handleException(final Exception exception) {
    ODataExceptionWrapper exceptionWrapper =
        new ODataExceptionWrapper(uriInfo, httpHeaders, servletConfig, servletRequest);
    ODataResponse oDataResponse = exceptionWrapper.wrapInExceptionResponse(exception);
    return oDataResponse;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.rest.ODataExceptionWrapper

      }

      odataResponse = extendedResponse.build();
    } catch (final Exception e) {
      exception = e;
      odataResponse = new ODataExceptionWrapper(context, request.getQueryParameters(), request.getAcceptHeaders())
          .wrapInExceptionResponse(e);
    }
    context.stopRuntimeMeasurement(timingHandle);

    if (context.isInDebugMode()) {
View Full Code Here

Examples of org.apache.olingo.odata2.core.rest.ODataExceptionWrapper

    when(context.getServiceFactory()).thenReturn(new MapperServiceFactory(errorCallback));

    //
    Map<String, String> queryParameters = Collections.emptyMap();
    List<String> acceptContentTypes = Arrays.asList("text/html");
    ODataExceptionWrapper exceptionWrapper = createWrapper(context, queryParameters, acceptContentTypes);
    ODataResponse response = exceptionWrapper.wrapInExceptionResponse(new Exception());

    // verify
    assertNotNull(response);
    assertEquals(HttpStatusCodes.BAD_REQUEST.getStatusCode(), response.getStatus().getStatusCode());
    String errorMessage = (String) response.getEntity();
View Full Code Here

Examples of org.apache.olingo.odata2.core.rest.ODataExceptionWrapper

    assertEquals("text/html", contentTypeHeader);
  }

  private ODataExceptionWrapper createWrapper(final ODataContextImpl context,
      final Map<String, String> queryParameters, final List<String> acceptContentTypes) throws URISyntaxException {
    ODataExceptionWrapper exceptionWrapper = new ODataExceptionWrapper(context, queryParameters, acceptContentTypes);

    return exceptionWrapper;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.core.rest.ODataExceptionWrapper

      }

      odataResponse = extendedResponse.build();
    } catch (final Exception e) {
      exception = e;
      odataResponse = new ODataExceptionWrapper(context, request.getQueryParameters(), request.getAcceptHeaders())
          .wrapInExceptionResponse(e);
    }
    context.stopRuntimeMeasurement(timingHandle);

    if (context.isInDebugMode()) {
View Full Code Here

Examples of org.apache.olingo.odata2.core.rest.ODataExceptionWrapper

      }

      odataResponse = extendedResponse.build();
    } catch (final Exception e) {
      exception = e;
      odataResponse = new ODataExceptionWrapper(context, request.getQueryParameters(), request.getAcceptHeaders())
          .wrapInExceptionResponse(e);
    }
    context.stopRuntimeMeasurement(timingHandle);

    if (context.isInDebugMode()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.