chore: more log to address controller errors

This commit is contained in:
simon lehericey 2024-04-02 15:41:36 +02:00
parent b245d9b063
commit 57927a3783
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5

View file

@ -6,13 +6,16 @@ class DataSources::AdresseController < ApplicationController
if response.success?
results = JSON.parse(response.body, symbolize_names: true)
render json: format_results(results)
else
render json: []
return render json: format_results(results)
end
else
render json: []
end
render json: []
rescue JSON::ParserError => e
Sentry.set_extras(body: response.body, code: response.code)
Sentry.capture_exception(e)
render json: []
end
private