Skip to content

Partially Addressed Error Handling for API Route#17

Open
MatthewTran22 wants to merge 2 commits intodevfrom
APIErrorHandle
Open

Partially Addressed Error Handling for API Route#17
MatthewTran22 wants to merge 2 commits intodevfrom
APIErrorHandle

Conversation

@MatthewTran22
Copy link
Copy Markdown

Some parts, like the check for duplicates or input validation, don't have dedicated methods.
Input validation only checks if the SKU isn't empty
Checking for duplicates is not implemented, so the error handling is not created yet
All other cases are handled

Copy link
Copy Markdown
Contributor

@NicholasLe04 NicholasLe04 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

left some comments/suggestions!

Comment on lines +77 to +78
except Exception as e:
raise_internal_error()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is catching an exception then raising another exception which isn't caught. perhaps we can change this so that the exception is caught. (maybe we raise it in the try block instead of the catch block?)

Comment on lines +91 to +92
except Exception as e:
raise_internal_error()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is catching an exception then raising another exception which isn't caught. perhaps we can change this so that the exception is caught. (maybe we raise it in the try block instead of the catch block?)

Comment on lines +108 to +109
except Exception as e:
raise_internal_error()
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is catching an exception then raising another exception which isn't caught. perhaps we can change this so that the exception is caught. (maybe we raise it in the try block instead of the catch block?)

Comment on lines +124 to +125
except Exception as e:
raise_internal_error() No newline at end of file
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is catching an exception then raising another exception which isn't caught. perhaps we can change this so that the exception is caught. (maybe we raise it in the try block instead of the catch block?)

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