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

PIK-XXX add error handling section to nlv2 README file #98

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions v2/api-validator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ to learn more about OpenAPI:
5. Restart the mock server.
6. Run all the tests.

## Error Handling
Error handling for APIs should be consistent and meaningful to allow consumers to respond appropriately. APIs should define error types for HTTP status codes in the 4xx (client errors) and 5xx (server errors) ranges. Examples include:

- 4xx: Bad requests, unauthorized access, or other client-side issues.
- 5xx: Server errors or unexpected failures.

To implement effective error handling:

- Adhere to the follow schema for all error responses to ensure clarity and consistency.
- Make sure to select the correct error type as suggested by schema (for example: `unknown-asset`, `unsupported-conversion`)
- Include sufficient details in error responses to allow consumers to diagnose issues effectively.
- Handle errors based on their type and status code to provide meaningful feedback to users.

Clear and consistent error handling ensures better collaboration with API consumers and enhances the user experience.

## Troubleshooting

If the tests fail catastrophically, it is possible to run the tests in three separate
Expand Down