phax / phoss-smp

phoss SMP - a Peppol and OASIS BDXR SMP Server, CEF eDelivery compliant
129 stars 37 forks source link

Propagation of errors from REST api #72

Closed emilbokenstrand closed 5 years ago

emilbokenstrand commented 6 years ago

Greetings,

When using the SMP's REST api to update the SMP and SML it would be nice to know if we got an error from the SML or an internal error when adding/deleting data to/from the SMP database.

I use com.helger.peppol.smpclient.SMPClient and when testing method saveServiceGroup() I receive no error when for example trying to add a participant that already exists in the SML. In the SMP log I see the error: com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 401: Unauthorized

Side note: Not sure if the GUI uses this REST api as well or if this is a separate issue but I can see that when trying to add a participant already in the SML from the GUI we have similar behaviour: We get positive feedback (but the participant is not added which is correct). The error in the log in this case is:com.sun.xml.ws.client.ClientTransportException: The server sent HTTP status code 400: Bad Request

Please let me know if you need more info!

Thanks for assisting

phax commented 5 years ago

In case of SML errors, they are now propagated will full stacktrace to the response. Additionally the return code changed to HTTP 500.