`sendError` should make sure that the detail is a string so it shows up in the response.
`JSON.stringify` does not convert `Error` objects to strings.