From 99a6ed749b3bf17a8963ec4a9e0640bf401f1579 Mon Sep 17 00:00:00 2001 From: James Westman Date: Fri, 17 Jun 2022 22:53:28 -0500 Subject: [PATCH] Fix JSON error messages The render_response implementation was missing, so it defaulted to a plain text error message. --- src/errors.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index c0cd50e..1df60ce 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -213,4 +213,8 @@ impl ResponseError for ApiError { } HttpResponse::build(self.status_code()).json(self.to_json()) } + + fn render_response(&self) -> HttpResponse { + self.error_response() + } }