Examples of handleError()


Examples of org.mojavemvc.exception.DefaultJSPErrorHandler.handleError()

        AppProperties properties = mock(AppProperties.class);
        when(properties.getProperty(DefaultJSPErrorHandler.JSP_ERROR_FILE))
            .thenReturn(errorJsp);

        ErrorHandler errorHandler = new DefaultJSPErrorHandler();
        View view = errorHandler.handleError(null, properties);

        assertTrue(view instanceof JSP);
        JSP jspView = (JSP) view;
        assertEquals(errorJsp, jspView.getJSPName());
    }
View Full Code Here

Examples of org.mojavemvc.exception.ErrorHandler.handleError()

        AppProperties properties = mock(AppProperties.class);
        when(properties.getProperty(DefaultJSPErrorHandler.JSP_ERROR_FILE))
            .thenReturn(errorJsp);

        ErrorHandler errorHandler = new DefaultJSPErrorHandler();
        View view = errorHandler.handleError(null, properties);

        assertTrue(view instanceof JSP);
        JSP jspView = (JSP) view;
        assertEquals(errorJsp, jspView.getJSPName());
    }
View Full Code Here

Examples of org.mojavemvc.exception.ErrorHandler.handleError()

   
    @Test
    public void handleError_NullException() throws Exception {

        ErrorHandler errorHandler = new DefaultErrorHandler();
        View view = errorHandler.handleError(null, properties);

        assertTrue(view instanceof PlainText);
        PlainText stackTrace = (PlainText) view;
        assertEquals("", stackTrace.toString());
    }
View Full Code Here

Examples of org.mojavemvc.exception.ErrorHandler.handleError()

    public void handleError_WithException() throws Exception {

        Exception e = new Exception("testing");
       
        ErrorHandler errorHandler = new DefaultErrorHandler();
        View view = errorHandler.handleError(e, properties);

        assertTrue(view instanceof PlainText);
        PlainText stackTrace = (PlainText) view;
        assertTrue(stackTrace.toString().startsWith("java.lang.Exception: testing"));
    }
View Full Code Here

Examples of org.mojavemvc.exception.ErrorHandler.handleError()

            view.render(req, res, properties);

        } catch (Throwable e) {

            logger.error("error processing request: ", e);
            view = errorHandler.handleError(e, properties);
            if (view != null) {
                /*
                 * we're not catching any exceptions thrown from rendering the
                 * error view
                 */
 
View Full Code Here

Examples of org.pentaho.reporting.designer.core.editor.report.layouting.ElementRenderer.handleError()

      final ElementRenderer rendererRoot = getElementRenderer();
      if (rendererRoot != null)
      {
        if (rendererRoot.draw(logicalPageAreaG2) == false)
        {
          rendererRoot.handleError(designerContext, renderContext);

          logicalPageAreaG2.scale(1f / scaleFactor, 1f / scaleFactor);
          logicalPageAreaG2.setPaint(Color.WHITE);
          logicalPageAreaG2.fill(area);
        }
View Full Code Here

Examples of org.springframework.util.ErrorHandler.handleError()

    if (errorHandler != null) {
      try {
        listener.onApplicationEvent(event);
      }
      catch (Throwable err) {
        errorHandler.handleError(err);
      }
    }
    else {
      listener.onApplicationEvent(event);
    }
View Full Code Here

Examples of org.springframework.util.ErrorHandler.handleError()

   * @see #setErrorHandler
   */
  protected void invokeErrorHandler(Throwable ex) {
    ErrorHandler errorHandler = getErrorHandler();
    if (errorHandler != null) {
      errorHandler.handleError(ex);
    }
    else if (logger.isWarnEnabled()) {
      logger.warn("Execution of JMS message listener failed, and no ErrorHandler has been set.", ex);
    }
  }
View Full Code Here

Examples of org.springframework.web.client.DefaultResponseErrorHandler.handleError()

        request.getBody().write(file);
       
        ClientHttpResponse response = request.execute();
        ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
        if (errorHandler.hasError(response)) {
          errorHandler.handleError(response);
          return null;
        }
        else {
          InputStream stream = response.getBody();
          return objectMapper.readValue(stream, Metadata.class);
View Full Code Here

Examples of org.springframework.web.client.ResponseErrorHandler.handleError()

        request.getBody().write(file);
       
        ClientHttpResponse response = request.execute();
        ResponseErrorHandler errorHandler = new DefaultResponseErrorHandler();
        if (errorHandler.hasError(response)) {
          errorHandler.handleError(response);
          return null;
        }
        else {
          InputStream stream = response.getBody();
          return objectMapper.readValue(stream, Metadata.class);
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.