chore(serializer): add sentry tags to have more details when serialization failed
This commit is contained in:
parent
b549a0ba83
commit
00643b968d
1 changed files with 22 additions and 10 deletions
|
@ -1,12 +1,20 @@
|
||||||
class SerializerService
|
class SerializerService
|
||||||
def self.dossier(dossier)
|
def self.dossier(dossier)
|
||||||
data = execute_query('serializeDossier', { number: dossier.id })
|
Sentry.with_scope do |scope|
|
||||||
data && data['dossier']
|
scope.set_tags(dossier_id: dossier.id)
|
||||||
|
|
||||||
|
data = execute_query('serializeDossier', { number: dossier.id })
|
||||||
|
data && data['dossier']
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.dossiers(procedure)
|
def self.dossiers(procedure)
|
||||||
data = execute_query('serializeDossiers', { number: procedure.id })
|
Sentry.with_scope do |scope|
|
||||||
data && data['demarche']['dossiers']
|
scope.set_tags(procedure_id: procedure.id)
|
||||||
|
|
||||||
|
data = execute_query('serializeDossiers', { number: procedure.id })
|
||||||
|
data && data['demarche']['dossiers']
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.demarches_publiques(after: nil)
|
def self.demarches_publiques(after: nil)
|
||||||
|
@ -20,12 +28,16 @@ class SerializerService
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.champ(champ)
|
def self.champ(champ)
|
||||||
if champ.private?
|
Sentry.with_scope do |scope|
|
||||||
data = execute_query('serializeAnnotation', { number: champ.dossier_id, id: champ.to_typed_id })
|
scope.set_tags(champ_id: champ.id)
|
||||||
data && data['dossier']['annotations'].first
|
|
||||||
else
|
if champ.private?
|
||||||
data = execute_query('serializeChamp', { number: champ.dossier_id, id: champ.to_typed_id })
|
data = execute_query('serializeAnnotation', { number: champ.dossier_id, id: champ.to_typed_id })
|
||||||
data && data['dossier']['champs'].first
|
data && data['dossier']['annotations'].first
|
||||||
|
else
|
||||||
|
data = execute_query('serializeChamp', { number: champ.dossier_id, id: champ.to_typed_id })
|
||||||
|
data && data['dossier']['champs'].first
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue