Uploaded image for project: 'WildFly EJB HTTP Client'
  1. WildFly EJB HTTP Client
  2. WEJBHTTP-58

Wildfly Http Client HttpServerHelper should log initial exception

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 1.1.7.Final, 1.0.28.Final
    • None
    • None

    Description

      It looks like an exception is thrown when unmarshalling, this ends up with HttpServerHelper.sendException, the Throwable e is going to be sent back, but at line 45 setStatusCode results in UndertowMessages.MESSAGES.responseAlreadyStarted , we should have sendException log the original Throwable e in some way, so that it is not lost.

       

      org.wildfly.httpclient.common.HttpServerHelper

       43     public static void sendException(HttpServerExchange exchange, int status, Throwable e) {
       44         try {
       45             exchange.setStatusCode(status);
       46             exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "application/x-wf-jbmar-exception;version=1");
       47             final MarshallingConfiguration marshallingConfiguration = new MarshallingConfiguration();
       48             marshallingConfiguration.setVersion(2);
       49             final Marshaller marshaller = RIVER_MARSHALLER_FACTORY.createMarshaller(marshallingConfiguration);
       50             OutputStream outputStream = exchange.getOutputStream();
       51             final ByteOutput byteOutput = Marshalling.createByteOutput(outputStream);
       52             // start the marshaller
       53             marshaller.start(byteOutput);
       54             marshaller.writeObject(e);
       55             marshaller.write(0);
       56             marshaller.finish();
       57             marshaller.flush();
       58             exchange.endExchange();
       59         } catch (Exception ex) {
       60             HttpClientMessages.MESSAGES.failedToWriteException(ex);
       61             exchange.endExchange();
       62         }
       63     }
      

      In this catch above we should some how also log the Throwable e

      Attachments

        Issue Links

          Activity

            People

              mshikalw Moulali Shikalwadi
              mshikalw Moulali Shikalwadi
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: