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

Update Error handling #1624

Closed
FSM1 opened this issue Oct 8, 2021 · 0 comments · Fixed by #1626
Closed

Update Error handling #1624

FSM1 opened this issue Oct 8, 2021 · 0 comments · Fixed by #1626
Assignees
Labels
Priority: P0 Critical Added to issues relating to a critical severity bugs.

Comments

@FSM1
Copy link
Contributor

FSM1 commented Oct 8, 2021

Update API error handling code in mkdir and upload calls

New Error response will have the following schema:

{
  "error": {
    "message": "Validation failed", 
    "code": 400,
    "details": [{"type:email", "message":"invalid email address"}]
  }
}

So, the equivalent check will be errorResponse.error.details[0].message.includes(... .
Would suggest to check the http response code instead of checking error message. I mean check whether it is 409 code, and if it is Show your custom message on ui.

Also the details field is optional. In all that cases if details is not there that case you need need to check errorResponse.error.message.includes(... . Response will be something like that

{
  "error": {
    "message": "Validation failed", 
    "code": 400,
  }
}

Originally posted by @sadiq1971 in https://github.com/ChainSafe/files-api/issues/1591#issuecomment-936560977

@FSM1 FSM1 self-assigned this Oct 8, 2021
@FSM1 FSM1 added the Priority: P0 Critical Added to issues relating to a critical severity bugs. label Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: P0 Critical Added to issues relating to a critical severity bugs.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant