Skip to content

Commit 7329109

Browse files
authored
FIX-OCT-1572: Ignore errors when 404 (#167)
## Description ## Definition of Done 1. [ ] Acceptance criteria are met. 2. [ ] PR is manually tested before the merge by developer(s). - [ ] Happy path is manually checked. 3. [ ] PR is manually tested by QA when their assistance is required (1). - [ ] Octant Areas & Test Cases are checked for impact and updated if required (2). 4. [ ] Unit tests are added unless there is a reason to omit them. 5. [ ] Automated tests are added when required. 6. [ ] The code is merged. 7. [ ] Tech documentation is added / updated, reviewed and approved (including mandatory approval by a code owner, should such exist for changed files). - [ ] BE: Swagger documentation is updated. 8. [ ] When required by QA: - [ ] Deployed to the relevant environment. - [ ] Passed system tests. --- (1) Developer(s) in coordination with QA decide whether it's required. For small tickets introducing small changes QA assistance is most probably not required. (2) [Octant Areas & Test Cases](https://docs.google.com/spreadsheets/d/1cRe6dxuKJV3a4ZskAwWEPvrFkQm6rEfyUCYwLTYw_Cc).
1 parent 865f2ae commit 7329109

File tree

1 file changed

+15
-10
lines changed
  • backend/app/modules/multisig_signatures

1 file changed

+15
-10
lines changed

backend/app/modules/multisig_signatures/core.py

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
import json
2+
from http import HTTPStatus
23
from typing import List, Tuple, Dict
34

45
from eth_account.messages import SignableMessage
56

7+
from app.exceptions import ExternalApiException
68
from app.infrastructure.database.models import MultisigSignatures
79
from app.infrastructure.external_api.safe.message_details import get_message_details
810
from app.infrastructure.external_api.safe.user_details import get_user_details
@@ -62,17 +64,20 @@ def approve_pending_signatures(
6264
approved_signatures.append(_create_signature_object(pending_signature))
6365
continue
6466

65-
message_details = get_message_details( # TODO extract API call to service
66-
pending_signature.msg_hash, is_mainnet=is_mainnet
67-
)
68-
confirmations = message_details["confirmations"]
69-
threshold = int(
70-
get_user_details(
67+
try:
68+
message_details = get_message_details( # TODO extract API call to service
69+
pending_signature.msg_hash, is_mainnet=is_mainnet
70+
)
71+
user_details = get_user_details(
7172
pending_signature.address, is_mainnet=is_mainnet
72-
)[ # TODO extract API call to service
73-
"threshold"
74-
]
75-
)
73+
) # TODO extract API call to service
74+
except ExternalApiException as e:
75+
if e.status_code == HTTPStatus.NOT_FOUND:
76+
continue
77+
raise e
78+
79+
confirmations = message_details["confirmations"]
80+
threshold = int(user_details["threshold"])
7681

7782
if len(confirmations) >= threshold:
7883
pending_signature.confirmed_signature = message_details["preparedSignature"]

0 commit comments

Comments
 (0)