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
|
package spectre
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ func ParseScope(s string) (Scope, error) {
|
||||||
case "recovery", "r":
|
case "recovery", "r":
|
||||||
return Recovery, nil
|
return Recovery, nil
|
||||||
default:
|
default:
|
||||||
return "", errors.New("unknown Scope")
|
return "", fmt.Errorf("unknown Scope %q; available [authentication, identification, recovery]", s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package spectre
|
package spectre
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ func ParseTemplate(s string) (Template, error) {
|
||||||
case "basic":
|
case "basic":
|
||||||
return Basic, nil
|
return Basic, nil
|
||||||
default:
|
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