Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve ReportPortalException to be structured object #100

Open
nvborisenko opened this issue Dec 6, 2022 · 0 comments
Open

Improve ReportPortalException to be structured object #100

nvborisenko opened this issue Dec 6, 2022 · 0 comments

Comments

@nvborisenko
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant