You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the frontend app implementation call a SDK endpoint through the middleware that calls external API that returns 401 status code response. The middleware fails with generic 500 error and doesn't propagate the original error and status code.
Describe the bug
Middleware doesn't propagate the original status code and error messages coming from the target API.
api-client fails with: ServerError: Response not successful: Received status code 401
middleware fails with: ServerError: Response not successful. Please, check server logs for more details.
Additional context
No response
Logs
Server
[Middleware] [Network error]: ServerError: Response not successful: Received status code 401
[Middleware]
[Middleware] ERROR Response not successful: Received status code 401
[Middleware]
[Middleware] at new ApolloError (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:2943:28)
[Middleware] at /Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:8479:19
[Middleware] at both (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:2329:53)
[Middleware] at /Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:2322:72
[Middleware] at new Promise (<anonymous>)
[Middleware] at Object.then (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:2322:24)
[Middleware] at Object.error (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:2331:26)
[Middleware] at notifySubscription (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:1744:18)
[Middleware] at onNotify (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:1783:3)
[Middleware] at SubscriptionObserver.error (/Users/bojanche/dev/frontend/storefront-sdk/packages/api-client/server/index.js:1836:5)
Browser:
```shwarn2 @ chunk-QWDWOYML.js:1449logError @ chunk-QWDWOYML.js:1623handleError @ chunk-QWDWOYML.js:1615(anonymous) @ chunk-QWDWOYML.js:1576Promise.catch (async)callWithAsyncErrorHandling @ chunk-QWDWOYML.js:1575invoker @ chunk-QWDWOYML.js:9397index.es.js:71 Uncaught (in promise) SDKError: Request failed with status code 500 at handleError (index.es.js:71:12) at Proxy.<anonymous> (index.es.js:254:27) at async callEndpoint (bundleDetail.vue:36:20)handleError @ index.es.js:71(anonymous) @ index.es.js:254Promise.catch (async)callWithAsyncErrorHandling @ chunk-QWDWOYML.js:1575invoker @ chunk-QWDWOYML.js:9397
The text was updated successfully, but these errors were encountered:
Environment
MacOS
Node v20
@vue-storefront/middleware
: 3.5.1@vue-storefront/sdk
: 1.1.2Reproduction
From the frontend app implementation call a SDK endpoint through the middleware that calls external API that returns 401 status code response. The middleware fails with generic 500 error and doesn't propagate the original error and status code.
Describe the bug
Middleware doesn't propagate the original status code and error messages coming from the target API.
api-client
fails with:ServerError: Response not successful: Received status code 401
middleware fails with:
ServerError: Response not successful. Please, check server logs for more details.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: