Skip to content

Commit 6248dbc

Browse files
committed
Raise before trying to access status
In case of an error the returned object does not respond to `#status`.
1 parent a5eb805 commit 6248dbc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fasp_data_sharing/app/models/fasp_data_sharing/activity_pub_object.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ class FaspDataSharing::ActivityPubObject
88

99
def fetch
1010
response = message_signature_request
11-
response = signature_request if response.status.in?([ 401, 403 ])
1211

1312
response.raise_for_status
13+
14+
response = signature_request if response.status.in?([ 401, 403 ])
15+
1416
JSON.parse(response.body.to_s) # TODO: simplify with response.json after next httpx release
1517
end
1618

0 commit comments

Comments
 (0)