Divyanshu-s13 opened a new issue, #3370:
URL: https://github.com/apache/apisix-dashboard/issues/3370

   ### Issue description
   
   The credentials list API helper throws a secondary runtime error while 
handling failures. In [credentials.ts:38], the catch block reads 
e.response.status directly. For network/CORS/timeout failures, response can be 
undefined, so this path crashes with a TypeError instead of handling the 
original failure.
   Where:
   [credentials.ts:38-45]
   
   ### Expected behavior
   
   - Error handling should be resilient.
   - If status is 404, return an empty credentials list.
   - For other failures, rethrow the original error without introducing a new 
TypeError.
   
   ### How to Reproduce
   
   1. Start the dashboard normally and open it in browser.
   2. Open browser DevTools, go to Network, and set throttling to Offline.
   3. In the app, navigate to a consumer’s Credentials page so the credentials 
list request is triggered.
   4. Check browser console.
   
   
   ### Screenshots
   
   _No response_
   
   ### Environment
   
   _No response_
   
   ### Additional context
   
   Actual result:
   
   1. App throws TypeError: Cannot read properties of undefined (reading 
status).
   2. Error points to [credentials.ts:40] in the catch handler.
   
   Expected result:
   
   1. No crash.
   2. If request fails without HTTP response, error should be handled safely.
   3. Only HTTP 404 should return empty list fallback; other errors should be 
rethrown cleanly.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to