mirror of
https://github.com/juanfont/headscale.git
synced 2025-08-28 13:49:04 +02:00
converted the returned error to an httpError
This commit is contained in:
parent
30a1f7e68e
commit
5fb38429c8
@ -91,7 +91,7 @@ func (h *Headscale) handleVerifyRequest(
|
|||||||
|
|
||||||
var derpAdmitClientRequest tailcfg.DERPAdmitClientRequest
|
var derpAdmitClientRequest tailcfg.DERPAdmitClientRequest
|
||||||
if err := json.Unmarshal(body, &derpAdmitClientRequest); err != nil {
|
if err := json.Unmarshal(body, &derpAdmitClientRequest); err != nil {
|
||||||
return fmt.Errorf("cannot parse derpAdmitClientRequest: %w", err)
|
return NewHTTPError(http.StatusBadRequest, "Bad Request: invalid JSON", fmt.Errorf("cannot parse derpAdmitClientRequest: %w", err))
|
||||||
}
|
}
|
||||||
|
|
||||||
nodes, err := h.state.ListNodes()
|
nodes, err := h.state.ListNodes()
|
||||||
|
Loading…
Reference in New Issue
Block a user