pagopa / interop-be-monorepo

Apache License 2.0
0 stars 1 forks source link

IMN-736 - pt 1 - API GW Agreement errors without passthrough / bubble-up #1009

Closed ecamellini closed 1 month ago

ecamellini commented 1 month ago

1st part of IMN-736

Case where a 404 is caught

image image

When the error is not caught

The original AxiosError is returned and then managed and logged by the makeApiProblem with the new branch I added. For example, here's what happens in the logs if I don't catch the 404 when getting an agreement by id i.e., removing the .catch from the promise:

image image

Case where the API GW throws its own error, no errors are caught

image image

Draft agreement case

Here no error is caught, but the agreement not found is thrown logging the root cause i.e., that the agreement is Draft

image