https://github.com/saucelabs/customerror
Custom errors standardizes errors across applications
https://github.com/saucelabs/customerror
custom-error go golang
Last synced: 8 months ago
JSON representation
Custom errors standardizes errors across applications
- Host: GitHub
- URL: https://github.com/saucelabs/customerror
- Owner: saucelabs
- License: mit
- Archived: true
- Created: 2021-09-24T23:43:32.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-02-23T06:19:07.000Z (almost 3 years ago)
- Last Synced: 2025-03-30T17:40:56.991Z (9 months ago)
- Topics: custom-error, go, golang
- Language: Go
- Homepage: https://github.com/saucelabs/customerror
- Size: 38.1 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
README
# customerror
`customerror` provides the base block to create custom errors. It also provides built-in custom errors covering some common cases. A Custom Error provides context - a `Message` to an optionally wrapped `Err`. Additionally a `Code` - for example "E1010", and `StatusCode` can be provided. Both static (pre-created), and dynamic (in-line) errors can be easily created. `Code` helps a company build a catalog of errors, which helps, and improves customer service.
## Install
`$ go get github.com/saucelabs/customerror@vX.Y.Z`
## Usage
See [`example_test.go`](example_test.go), and [`customerror_test.go`](customerror_test.go) file.
## Documentation
Run `$ make doc` or check out [online](https://pkg.go.dev/github.com/saucelabs/customerror).
## Development
Check out [CONTRIBUTION](CONTRIBUTION.md).
### Release
1. Update [CHANGELOG](CHANGELOG.md) accordingly.
2. Once changes from MR are merged.
3. Tag and release.
## Roadmap
Check out [CHANGELOG](CHANGELOG.md).