Get rid of dynamic errors
This commit is contained in:
parent
25b790d025
commit
d6739386a0
10 changed files with 53 additions and 22 deletions
|
@ -16,6 +16,7 @@ const (
|
|||
errPreAuthKeyNotFound = Error("AuthKey not found")
|
||||
errPreAuthKeyExpired = Error("AuthKey expired")
|
||||
errSingleUseAuthKeyHasBeenUsed = Error("AuthKey has already been used")
|
||||
errNamespaceMismatch = Error("namespace mismatch")
|
||||
)
|
||||
|
||||
// PreAuthKey describes a pre-authorization key usable in a particular namespace.
|
||||
|
@ -87,7 +88,7 @@ func (h *Headscale) GetPreAuthKey(namespace string, key string) (*PreAuthKey, er
|
|||
}
|
||||
|
||||
if pak.Namespace.Name != namespace {
|
||||
return nil, errors.New("Namespace mismatch")
|
||||
return nil, errNamespaceMismatch
|
||||
}
|
||||
|
||||
return pak, nil
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue