(fix): Handle resource_paths without content after slash ('/')#40
(fix): Handle resource_paths without content after slash ('/')#40george42-ctds wants to merge 4 commits into
Conversation
|
The style in this PR agrees with This formatting comment was generated automatically by a script in uc-cdis/wool. |
| for p in data["resource_paths"]: | ||
| if not p.split("/")[1:]: | ||
| msg = f"Request creation failed. Resource path '{p}' does not have content after a forward slash ('/')." | ||
| raise_error(logger, msg, body) |
There was a problem hiding this comment.
the validity of resource paths should be Arborist's concern, not Requestor's. It looks like Requestor would work fine no matter the format of the resource path. What error/issue are we actually trying to fix here?
There was a problem hiding this comment.
Requestor returns a 500 when receiving a request with a bad resource_path (without a slash), after receiving a 400 from Arborist.
There was a problem hiding this comment.
if this is when creating a new request, it sounds to me like we should catch that 400 from arborist, and return a 400 to the user after getting one from arborist. We shouldn't duplicate the input validation from the server into the client. Arborist probably returns a nice error message that Requestor can forward to the user
if the error happens later, during the automatic call to arborist when requests are approved, then it's a bit more tricky
Jira Ticket: None
New Features
Breaking Changes
Bug Fixes
Improvements
Dependency updates
Deployment changes