5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 01:26:21 +00:00

fix: buscar un código de respuesta general

This commit is contained in:
f 2024-03-19 11:20:49 -03:00
parent 48d8d2d8d8
commit 93ebb6431a
No known key found for this signature in database
8 changed files with 8 additions and 8 deletions

View file

@ -16,7 +16,7 @@ class ActivityPub
response = site.social_inbox.dereferencer.get(uri: actor.uri)
# @todo Fallar cuando la respuesta no funcione?
return unless response.ok?
return unless response.success?
return if response.miss? && actor.content.present?
actor.object.update(content: FastJsonparser.parse(response.body))

View file

@ -22,7 +22,7 @@ class ActivityPub
# @todo Fallar cuando la respuesta no funcione?
# @todo Eliminar en 410 Gone
return unless response.ok?
return unless response.success?
# Ignorar si ya la caché fue revalidada y ya teníamos el
# contenido
return if response.hit? && object.content.present?

View file

@ -10,7 +10,7 @@ class ActivityPub
def perform(site:, activity:, action:)
response = site.social_inbox.inbox.public_send(action, id: activity)
raise response.body unless response.ok?
raise response.body unless response.success?
end
end
end

View file

@ -15,7 +15,7 @@ class ActivityPub
response = site.social_inbox.dereferencer.get(uri: uri)
next unless response.ok?
next unless response.success?
# @todo Validate schema
next unless response.parsed_response.is_a?(DistributedPress::V1::Social::ReferencedObject)

View file

@ -25,7 +25,7 @@ class ActivityPub
client = remote_flag.main_site.social_inbox.client_for(uri.origin)
response = client.post(endpoint: uri.path, body: remote_flag.content)
raise 'No se pudo enviar el reporte' unless response.ok?
raise 'No se pudo enviar el reporte' unless response.success?
remote_flag.report!
rescue Exception => e

View file

@ -53,7 +53,7 @@ class ActivityPub
def process(stage)
response = yield
return if response.ok?
return if response.success?
logs[stage] ||= []
logs[stage] << { body: response.body, code: response.code }

View file

@ -52,7 +52,7 @@ class ActivityPub
def process!
response = client.get(download_url)
raise FediblockDownloadError unless response.ok?
raise FediblockDownloadError unless response.success?
Fediblock.transaction do
csv = response.parsed_response

View file

@ -84,7 +84,7 @@ class DeploySocialDistributedPress < Deploy
response = hook_client.put(event: event, hook: webhook)
raise ArgumentError, response.body unless response.ok?
raise ArgumentError, response.body unless response.success?
rescue ArgumentError => e
ExceptionNotifier.notify_exception(e, data: { site_id: site.name, usuarie_id: rol.usuarie_id })
end