dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
845 stars 465 forks source link

SDK: Improved Error Handling in SDK Client Library #28816

Closed fmontes closed 3 months ago

fmontes commented 3 months ago

Parent

28404

Task description

As a developer using the dotCMS SDK client library, I want to see informative error messages when there is an issue with a request, so that I can quickly identify and resolve the issue.

Acceptance Criteria

External Links

N/A

Assumptions & Initiation Needs

N/A

Quality Assurance Notes & Workarounds

N/A

zJaaal commented 2 months ago

IQA Failed

The errors are looking great but we have an [object Object] error that we should clean up, looks like at some part of the error bubbling the environment is expecting an string. We should show error messages effectively in the console and in the environment the code is running. Also in the 404 error maybe we could change the URL in the error message for path since the parameter is called path in the SDK

[object Object]

Screenshot 2024-06-18 at 4 21 11 PM

404

Screenshot 2024-06-18 at 4 17 07 PM

401

Screenshot 2024-06-18 at 4 17 50 PM

403

Screenshot 2024-06-18 at 4 20 59 PM
KevinDavilaDotCMS commented 2 months ago

I did the test and I can't see that error screen When an error occurs from the SDK, the NextJS application displays the errors like this

Browser: Screenshot 2024-06-19 at 10 49 23 AM

Terminal: Screenshot 2024-06-19 at 10 49 48 AM

zJaaal commented 2 months ago

I did the test and I can't see that error screen When an error occurs from the SDK, the NextJS application displays the errors like this

Browser: Screenshot 2024-06-19 at 10 49 23 AM

Terminal: Screenshot 2024-06-19 at 10 49 48 AM

IQA Passed

I tested it again and you are right! Looks like a cache thing.

Screenshot 2024-06-19 at 1 00 33 PM
bryanboza commented 2 months ago

Fixed, now we are able to get the corresponding error to every case, we receive the error status code and the correct message. However we are not doing anything at FE level in the provided examples, every one need to take actions in case of every error.

Tested on trunk [_2181d4a]