Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving issue [API requests that don't return a 2XX HTTP Status result in an exception being raised ] #6260 #6291

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Manancode
Copy link
Member

This is a Commit to solve issue #6260

Handle non-2XX status codes in apiRequest function

This PR addresses the issue of uncaught exceptions for non-2XX status codes in the apiRequest function. The changes include:

  1. Modified the _handleError function to return error response data for AxiosErrors instead of rejecting the promise.
  2. Updated documentation to explain the new behavior for non-2XX status codes.
  3. Added an example in the documentation demonstrating how to handle different status codes.

These changes allow users to handle different status codes without uncaught exceptions while maintaining the existing API structure.

Copy link

netlify bot commented Sep 14, 2024

Deploy Preview for plone-components canceled.

Name Link
🔨 Latest commit 1ff20cd
🔍 Latest deploy log https://app.netlify.com/sites/plone-components/deploys/66e5743d7bc06300088fbf5b

@stevepiercy
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants