mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 06:42:32 -05:00
rescue json parse error
This commit is contained in:
1 parent
a92bd0ad0f
commit
94d745cf1c
1 file changed
+6
@@ -19,6 +19,12 @@ module Api
|
||||
|
||||
render json: { error: e.message }, status: :forbidden
|
||||
end
|
||||
|
||||
rescue_from JSON::ParserError do |e|
|
||||
Rollbar.error(e) if defined?(Rollbar)
|
||||
|
||||
render json: { error: "JSON parse error: #{e.message}" }, status: :unprocessable_entity
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
Reference in new issue
Block a user