Skip to content

Commit d67a5f9

Browse files
authored
refactor: raise AccountsError
Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com>
1 parent 5eefe50 commit d67a5f9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/ape_accounts/accounts.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,12 +285,12 @@ def unlock(self, passphrase: str | None = None):
285285
try:
286286
private_key = self.__decrypt_keyfile(passphrase)
287287

288-
except InvalidPasswordError:
288+
except InvalidPasswordError as err:
289289
if attempts < 3:
290290
logger.error("Invalid password")
291291
attempts += 1
292292
else:
293-
raise
293+
raise AccountsError(f"Failed to unlock after {attempts} attempts.") from err
294294

295295
self.__cached_signer = ApeSigner(private_key=private_key)
296296
self.locked = False

0 commit comments

Comments
 (0)