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 argumentRegisterErrorHandlerOn
now requires a concrete instance of the error as its second argumentRegisterStringErrorHandler
has been removed, use staticerrors.New
inRegisterErrorHandler
to get this to workRegisterStringErrorHandlerOn
has been removed, use staticerrors.New
inRegisterErrorHandlerOn
to get this to workRegisterCustomErrorTypeHandler
has been removed, wrap unexported errors from libraries to create handlers for theseRegisterCustomErrorTypeHandlerOn
has been removed, wrap unexported errors from libraries to create handlers for theseErrorRegistry
changes:DefaultCode
has been removed, useRegisterDefaultHandler
insteadDefaultResponse
has been removed, useRegisterDefaultHandler
insteadSetDefaultResponse
has been removed, useRegisterDefaultHandler
instead