Skip to content

v3.0.0

Latest
Compare
Choose a tag to compare
@survivorbat survivorbat released this 02 Dec 08:29
· 2 commits to master since this release
a773aa4

Change the internal method of saving errors entirely to make use of errors.As and errors.Is, removing the need for 3 separate methods as suggested in #7 by @bkmeneguello and implemented in #8.

V3 migration guide

V3 completely revamps the ErrorRegistry and now utilises the errors package to match errors.
The following changes have been made:

  • RegisterErrorHandler now requires a concrete instance of the error as its first argument
  • RegisterErrorHandlerOn now requires a concrete instance of the error as its second argument
  • RegisterStringErrorHandler has been removed, use static errors.New in RegisterErrorHandler to get this to work
  • RegisterStringErrorHandlerOn has been removed, use static errors.New in RegisterErrorHandlerOn to get this to work
  • RegisterCustomErrorTypeHandler has been removed, wrap unexported errors from libraries to create handlers for these
  • RegisterCustomErrorTypeHandlerOn has been removed, wrap unexported errors from libraries to create handlers for these
  • ErrorRegistry changes:
    • DefaultCode has been removed, use RegisterDefaultHandler instead
    • DefaultResponse has been removed, use RegisterDefaultHandler instead
    • SetDefaultResponse has been removed, use RegisterDefaultHandler instead