mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 05:00:01 +02:00
Improve error report when user passes a private key (#22726)
The error reported when a user passes a private ssh key as their ssh public key is not very nice. This PR improves this slightly. Ref #22693 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
parent
ccb3851281
commit
2914c5299b
5 changed files with 13 additions and 0 deletions
|
@ -24,6 +24,9 @@ func (err ErrKeyUnableVerify) Error() string {
|
|||
return fmt.Sprintf("Unable to verify key content [result: %s]", err.Result)
|
||||
}
|
||||
|
||||
// ErrKeyIsPrivate is returned when the provided key is a private key not a public key
|
||||
var ErrKeyIsPrivate = util.NewSilentWrapErrorf(util.ErrInvalidArgument, "the provided key is a private key")
|
||||
|
||||
// ErrKeyNotExist represents a "KeyNotExist" kind of error.
|
||||
type ErrKeyNotExist struct {
|
||||
ID int64
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue