Bug #16630

GXInboundResponse does not detect exception

Added by Manuele Simi 9 months ago. Updated 9 months ago.

Status:ClosedStart date:May 04, 2019
Priority:UrgentDue date:
Assignee:Manuele Simi% Done:


Sprint:zz - GXRest


When returning an Error code from the service with:

GXOutboundErrorResponse.throwException(she, Response.Status.fromStatusCode(she.getStatus()));

At caller side, GXInboundResponse does not correctly detect the exception with the hasException() method.

Screen Shot 2019-05-06 at 8.56.41 AM.png - HasExceptionDebug (276 KB) Manuele Simi, May 06, 2019 02:58 PM

Screen Shot 2019-05-07 at 12.13.43 AM.png (125 KB) Manuele Simi, May 07, 2019 06:14 AM



#1 Updated by Manuele Simi 9 months ago

  • Status changed from New to In Progress

#2 Updated by Manuele Simi 9 months ago

I'm currently not able to reproduce the error. In my tests, exceptions are correctly detected.

I definitely need more information to investigate this issue. More specifically:

1) a pointer to the code on svn that throws the Exception service side
2) debug information on the GXInboundResponse returned by the request. For a comparison, I'm attaching a debug session where I show the response object and its members' values.

#3 Updated by Lucio Lelii 9 months ago

I have finally found the problem, when 401 is set as response status the serialization doesn't work, I don't know why.

try this code:

GXOutboundErrorResponse.throwException(she, 401);

#4 Updated by Lucio Lelii 9 months ago

  • Assignee changed from Lucio Lelii to Manuele Simi

#5 Updated by Manuele Simi 9 months ago

  • Status changed from Feedback to In Progress

#6 Updated by Manuele Simi 9 months ago

I can't find an explanation to this issue. In my tests I can return a 401 with no problem as follows:

GXOutboundErrorResponse.throwException(new UserNotAuthorizedException("Error in methodTwo"),Response.Status.UNAUTHORIZED);

I even tried to reproduce the Exception hierarchy of the Storage Hub, but still I can return the code and attach the Exception (see the screenshot).

The only viable solution I see is to debug the createFolder() of the SH with the Jersey Test framework. Or we change the status code and that's it. I do not have other ideas how to investigate this issue.

#7 Updated by Lucio Lelii 9 months ago

  • % Done changed from 0 to 100
  • Status changed from In Progress to Closed

since this is no more a blocking issue, we can investigate it in the future opening a task to do it, I'm going to close this ticket.

#8 Updated by Pasquale Pagano 9 months ago

@lucio.lelii@isti.cnr.it, have you changed the status code? If not, the issue is managed by your client?

#9 Updated by Lucio Lelii 9 months ago

Yes, I have changed the status

Also available in: Atom PDF