Skip to content

Conversation

@whoabuddy
Copy link
Contributor

This PR implements a generic structure per handler where:

  • variables used are defined/typed at the top
  • inputs are checked (undefined = 400 response)
  • try to get/calculate values (null = 404 response)
  • catch errors and report as 404 response
  • return response in correct format

Tracking:

whoabuddy added 3 commits May 12, 2022 07:57
This consolidates a lot of the function calls into a single try/catch statement, where errors from upstream functions can be returned as a 404 Response.

In addition each endpoint follows a simple three part structure: check inputs, get/calculate data, return response
@whoabuddy whoabuddy merged commit 276a3aa into develop May 12, 2022
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.

Review endpoint error handling Bug: Get User ID API returns not intended status code Bug: Exception if contract principal is passed

2 participants