fix: enhance UI error handling with HTTP codes#79
fix: enhance UI error handling with HTTP codes#79harrshita123 wants to merge 1 commit intoPSMRI:developfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
does this really work? A lot of APIs respond with SUCCESS 200 OK, but still has errors inside the data. |



📋 Description
JIRA ID: PSMRI/AMRIT#113
Because the backend (
ECD-API) is being updated to return proper REST HTTP status codes (400, 401, 500) instead of hiding errors inside a200 OKresponse, our frontend HTTP Interceptor needed to be updated to catch these new responses correctly.This PR refactors
http-interceptor.service.ts:5002) inside successful responses.catchErrorpipeline to properly intercept standardHttpErrorResponseobjects.sessionStorageand redirects to the login page on401 Unauthorizedor403 Forbiddenerrors.400validation errors and500server errors to our user-friendly dialogue popups.✅ Type of Change
ℹ️ Additional Information
Testing & Context:
ng build --configuration=production) to ensure the updated interceptor didn't introduce any strict TypeScript typing errors.catchErrorlogic was streamlined using standardif/elsechecks and anArray.some()method for excluded endpoints to keep the interceptor fast and performant.ECD-APIis merged, as this UI update directly relies on the backend returning standard HTTP codes.