Better parsing error for scope and template
continuous-integration/woodpecker the build was successful
Details
continuous-integration/woodpecker the build was successful
Details
Signed-off-by: jolheiser <john.olheiser@gmail.com>main
parent
2514b79913
commit
f27be2ffff
4
scope.go
4
scope.go
|
@ -1,7 +1,7 @@
|
|||
package spectre
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -41,7 +41,7 @@ func ParseScope(s string) (Scope, error) {
|
|||
case "recovery", "r":
|
||||
return Recovery, nil
|
||||
default:
|
||||
return "", errors.New("unknown Scope")
|
||||
return "", fmt.Errorf("unknown Scope %q; available [authentication, identification, recovery]", s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package spectre
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
)
|
||||
|
||||
|
@ -39,7 +39,7 @@ func ParseTemplate(s string) (Template, error) {
|
|||
case "basic":
|
||||
return Basic, nil
|
||||
default:
|
||||
return "", errors.New("unknown Template")
|
||||
return "", fmt.Errorf("unknown Template %q; available [maximum, long, medium, short, pin, name, phrase, basic]", s)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue