mirror of
https://github.com/micromdm/micromdm/
synced 2026-08-07 18:15:47 +08:00
implement failer for device response
Ensures that errors are returned in a structured JSON format.
This commit is contained in:
@@ -46,6 +46,8 @@ type getDevicesResponse struct {
|
||||
Err error `json:"err,omitempty"`
|
||||
}
|
||||
|
||||
func (r getDevicesResponse) Failed() error { return r.Err }
|
||||
|
||||
func decodeListDevicesRequest(ctx context.Context, r *http.Request) (interface{}, error) {
|
||||
defer r.Body.Close()
|
||||
var opts ListDevicesOption
|
||||
|
||||
Reference in New Issue
Block a user