All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Added
NewNotFoundError
. - Added built-in languages constants.
- Now when using
WithLanguage
, it lookups for bothxy
andxy-ZW
. - Added translations to the prefix.
- Improved error messages.
- Added Catalog of errors.
- Added support for translations.
- JSON error should only contain keys with content.
- Fixed
fields
MarshalJSON
.
WithField
which allows to pass a single Key/Value pair.WithFields
which allows to set the whole map of fields. It's thread safe.
- Added the ability to factorize (
NewFactory
) custom errors with pre-defined tags and fields.
- Added the ability to add fields (
WithFields
) to the error enhancing the error message with structured information.
WithIgnoreString
now also check the underlying error message for the given string.
- Added the ability to categorize errors with a custom tags (
WithTags
) enhancing the error message tags.
- Fixed type in the
WithStatusCode
Option
.
WithIgnoreString
Option
accepts a slice of strings.- Added ability to create messages with just
StatusCode
, or justCode
, but noMessage
.StatusCode
takes precedence overCode
.
WithIgnoreFunc
Option
which allows to ignore the error (returnnil
) under the specified condition.WithIgnoreString
Option
which allows to ignore the error (returnnil
) ifMessage
contains the specified string.NewHTTPError
test.
NewHTTPError
for simple HTTP error messages, e.g.: "not found".
- Improved JSON representation/marshalling
- Added tests
- Updated deps
- Updating github CI dependencies
- Updating CI to use Go 1.19
- Updating CI linter version
- Linting the code
- Tests covering
.Is
.`
.Is
is on a pointer instead of value.
- API info is only added to error message on
APIError
.
- Added ability to pre-append
Option
s.
- Functional
Option
s.
New
now implements the functional optional pattern.
- Removed
SetStatusCode
.
Wrap
now accepts a list of errors.
- CI Pipeline:
- Lint
- Tests
- Documentation:
- Package's documentation (
doc.go
) - Meaningful code comments, and symbol names (
const
,var
,func
) -
GoDoc
server tested -
README.md
-
LICENSE
- Files has LICENSE in the header
- Useful
CHANGELOG.md
- Clear
CONTRIBUTION.md
- Package's documentation (
- Automation:
-
Makefile
-
- Testing:
- Coverage 80%+
- Unit test
- Real testing
- Examples:
- Example's test file
- Ability to create custom errors.
- Ability to create custom errors with code.
- Ability to create custom errors with status code.
- Ability to create custom errors with message.
- Ability to create custom errors wrapping an error.
- Ability to create static (pre-created) custom errors.
- Ability to create dynamic (in-line) custom errors.
- Ability to print a custom error with a dynamic, and custom message.