♻️ Use internal error for ResponseType domain error

This commit is contained in:
Maxim Lebedev 2022-01-30 01:47:05 +05:00
parent f62ce1db0a
commit 878aee22a2
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
1 changed files with 5 additions and 2 deletions

View File

@ -1,7 +1,6 @@
package domain package domain
import ( import (
"errors"
"fmt" "fmt"
"strconv" "strconv"
"strings" "strings"
@ -29,7 +28,11 @@ var (
ResponseTypeCode ResponseType = ResponseType{uid: "code"} ResponseTypeCode ResponseType = ResponseType{uid: "code"}
) )
var ErrResponseTypeUnknown error = errors.New("unknown grant type") var ErrResponseTypeUnknown error = NewError(
ErrorCodeUnsupportedResponseType,
"unknown grant type",
"https://indieauth.net/source/#authorization-request",
)
// ParseResponseType parse string as response type struct enum. // ParseResponseType parse string as response type struct enum.
func ParseResponseType(uid string) (ResponseType, error) { func ParseResponseType(uid string) (ResponseType, error) {