Skip to content

Commit

Permalink
apply Zoltan suggestion for better error description
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivansete-status committed Oct 2, 2024
1 parent a8dd5e3 commit a9d10e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion waku/waku_keystore/conversion_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ proc decode*(encodedCredential: seq[byte]): KeystoreResult[KeystoreMembership] =
return err(
AppKeystoreError(
kind: KeystoreJsonError,
msg: "error in conversion_utils decode: " & getCurrentExceptionMsg(),
msg: "error during decoding credentials: " & getCurrentExceptionMsg(),
)
)
except Exception: #parseJson raises Exception
Expand Down
15 changes: 9 additions & 6 deletions waku/waku_keystore/keystore.nim
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ proc createAppKeystore*(
err(
AppKeystoreError(
kind: KeystoreOsError,
msg: "error in createAppKeystore: " & getCurrentExceptionMsg(),
msg: "error while writing keystore: " & getCurrentExceptionMsg(),
)
)
finally:
Expand Down Expand Up @@ -122,35 +122,38 @@ proc loadAppKeystore*(
return err(
AppKeystoreError(
kind: KeystoreJsonError,
msg: "error in loadAppKeystore: " & getCurrentExceptionMsg(),
msg:
"error during loading keystore, JsonParsingError: " &
getCurrentExceptionMsg(),
)
)
except ValueError:
return err(
AppKeystoreError(
kind: KeystoreJsonError,
msg: "error in loadAppKeystore: " & getCurrentExceptionMsg(),
msg:
"error during loading keystore, ValueError: " & getCurrentExceptionMsg(),
)
)
except OSError:
return err(
AppKeystoreError(
kind: KeystoreOsError,
msg: "error in loadAppKeystore: " & getCurrentExceptionMsg(),
msg: "error during loading keystore, OSError: " & getCurrentExceptionMsg(),
)
)
except Exception: #parseJson raises Exception
return err(
AppKeystoreError(
kind: KeystoreOsError,
msg: "error in loadAppKeystore: " & getCurrentExceptionMsg(),
msg: "error during loading keystore, Exception: " & getCurrentExceptionMsg(),
)
)
except IOError:
return err(
AppKeystoreError(
kind: KeystoreIoError,
msg: "error in loadAppKeystore: " & getCurrentExceptionMsg(),
msg: "error during loading keystore, IOError: " & getCurrentExceptionMsg(),
)
)

Expand Down

0 comments on commit a9d10e6

Please sign in to comment.