Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(common/lib/utils): catch error on bad b64 string inputs; add tests #222

Merged
merged 2 commits into from
May 4, 2024

Conversation

crookse
Copy link
Contributor

@crookse crookse commented Oct 31, 2023

Summary

Hi, I was working with Arweave transactions and my transactions were failing because I was passing in undefined tag values. Didn't catch this easily because my env was non-TS. The error message thrown wasn't too helpful (reading properties of undefined. reading 'replace'), so I'm proposing this error with a cause to improve and quicken the debugging process.

Did the following:

  • Add UtilsError and throw it if decoding/encoding non-strings
  • Add tests

@rosmcmahon
Copy link
Member

firstly, sorry for the delay in reviewing this!
secondly, what function specifically were you calling that led on to this? yes, b64UrlEncode/b64UrlDecode can be called directly, but these are generally internal functions, so we might just be bubbling up a new equally confusing error message to the dev.
see this commit here for reference: 55a212a

@xgocn
Copy link

xgocn commented May 3, 2024

maybe the same situation? #228

@rosmcmahon rosmcmahon merged commit e1955d4 into ArweaveTeam:master May 4, 2024
7 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants