Improve ReportPortalException to be structured object
Opened this issue · 0 comments
nvborisenko commented
Now we have this error in output
InternalServerError (500) POST http://localhost:8080/api/v1/demo/item)
---> ReportPortal.Client.ReportPortalException: Response status code does not indicate success: InternalServerError (500) POST http://localhost:8080/api/v1/demo/item
---> System.Net.Http.HttpRequestException: Response message: {"errorCode":5000,"message":"Unclassified error [Ambiguous handler methods mapped for '/v1/demo/item': {public com.epam.ta.reportportal.demodata.model.DemoDataRs com.epam.ta.reportportal.demodata.DemoDataController.generate(java.lang.String,com.epam.ta.reportportal.demodata.model.DemoDataRq,com.epam.ta.reportportal.commons.ReportPortalUser), public com.epam.ta.reportportal.ws.model.EntryCreatedAsyncRS com.epam.ta.reportportal.ws.controller.TestItemController.startRootItem(java.lang.String,com.epam.ta.reportportal.commons.ReportPortalUser,com.epam.ta.reportportal.ws.model.StartTestItemRQ)}]"}
We see some structured information in http response (errorCode
and message
). To simplify output, we can try to deserialize response, and throw "good" exception which will keep all information inside appropriate object.
Main goal is simplifying output.