handle request object

This commit is contained in:
Livio Amstutz 2021-10-25 11:53:59 +02:00
parent 72a9829117
commit f067d723f2
7 changed files with 196 additions and 36 deletions

View file

@ -64,6 +64,7 @@ const (
ServerError errorType = "server_error"
InteractionRequired errorType = "interaction_required"
LoginRequired errorType = "login_required"
RequestNotSupported errorType = "request_not_supported"
)
var (
@ -118,6 +119,11 @@ var (
ErrorType: LoginRequired,
}
}
ErrRequestNotSupported = func() *Error {
return &Error{
ErrorType: RequestNotSupported,
}
}
)
// DefaultToServerError checks if the error is an Error