-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Improve golang error handing part 1 * Fix generic error * Improve usability of errors * Documentation * Documentation * Docs * Version bump
- Loading branch information
Showing
12 changed files
with
292 additions
and
527 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,38 @@ func main() { | |
} | ||
``` | ||
|
||
## Errors & Error Handling | ||
|
||
All API calls return an err as their final return value. Below is documented the errors you might want to check for. You can check `error.Body` on all errors to see the full HTTP response. | ||
|
||
### BadRequestError | ||
|
||
`BadRequestError` is returned when a you make a bad request to Mux, this likely means you've passed in an invalid parameter to the API call. | ||
|
||
### UnauthorizedError | ||
|
||
`UnauthorizedError` is returned when Mux cannot authenticate your request. [You should check you have configured your credentials correctly.](#authentication) | ||
|
||
### ForbiddenError | ||
|
||
`ForbiddenError` is returned you don't have permission to access that resource. [You should check you have configured your credentials correctly.](#authentication) | ||
|
||
### NotFoundError | ||
|
||
`NotFoundError` is returned when a resource is not found. This is useful when trying to get an entity by its ID. | ||
|
||
### TooManyRequestsError | ||
|
||
`TooManyRequestsError` is returned when you exceed the manimum request that Mux allows. Please get in touch with [[email protected]](mailto:[email protected]) if you need to talk about this limit. | ||
|
||
### ServiceError | ||
|
||
`ServiceError` is returned when Mux returns a HTTP 5XX Status Code. If you encounter this reproducibly, please get in touch with [[email protected]](mailto:[email protected]). | ||
|
||
### GenericOpenAPIError | ||
|
||
`GenericOpenAPIError` is a fallback Error which may be returned in some edge cases. This will be deprecated in a later release but remains present for API compatibility. | ||
|
||
## Documentation | ||
|
||
[Be sure to check out the documentation in the `docs` directory.](docs/) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.