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

chore: clean up error handling #33

Merged
merged 1 commit into from
Nov 6, 2024
Merged

chore: clean up error handling #33

merged 1 commit into from
Nov 6, 2024

Conversation

EvanHahn
Copy link
Contributor

@EvanHahn EvanHahn commented Nov 6, 2024

This change:

  • Normalizes response bodies to something like this:

    {
      "error": {
        "code": "SOMETHING_BAD",
        "message": "Something went wrong"
      }
    }
  • Adds error codes for various errors

  • Changes some 403s to 401s for correctness

See also: digidem/comapeo-core#955

This change:

- Normalizes response bodies to something like this:

  ```
  {
    "error": {
      "code": "SOMETHING_BAD",
      "message": "Something went wrong"
    }
  }
  ```

- Adds error codes for various errors

- Changes some 403s to 401s for correctness
EvanHahn added a commit to digidem/comapeo-core that referenced this pull request Nov 6, 2024
This turns the server's `TOO_MANY_PROJECTS` error into the
`SERVER_HAS_TOO_MANY_PROJECTS` error, and the `PROJECT_NOT_IN_ALLOWLIST`
error into `PROJECT_NOT_IN_SERVER_ALLOWLIST` error.

See <digidem/comapeo-cloud#33>, which adds these
codes.
@EvanHahn EvanHahn merged commit 5ad90ff into main Nov 6, 2024
2 checks passed
@EvanHahn EvanHahn deleted the error-codes branch November 6, 2024 16:07
EvanHahn added a commit to digidem/comapeo-core that referenced this pull request Nov 6, 2024
This turns the server's `TOO_MANY_PROJECTS` error into the
`SERVER_HAS_TOO_MANY_PROJECTS` error, and the `PROJECT_NOT_IN_ALLOWLIST`
error into `PROJECT_NOT_IN_SERVER_ALLOWLIST` error.

See <digidem/comapeo-cloud#33>, which adds these
codes.
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.

1 participant