From a208ea6bb75431fb4cefbb243e0ff109a369ef11 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 10 Feb 2025 18:16:56 -0800 Subject: [PATCH] Update api_controller.rb Change render_unprocessable_entity_response to render the errors hash instead of the exception so that we get more helpful errors. --- app/controllers/api/v1/api_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/api/v1/api_controller.rb b/app/controllers/api/v1/api_controller.rb index 887eeaa..c2a6628 100644 --- a/app/controllers/api/v1/api_controller.rb +++ b/app/controllers/api/v1/api_controller.rb @@ -86,7 +86,7 @@ module Api end def render_unprocessable_entity_response(exception) - render json: ErrorBlueprint.render_as_json(nil, exception: exception), + render json: ErrorBlueprint.render_as_json(nil, errors: exception.to_hash), status: :unprocessable_entity end