-
Notifications
You must be signed in to change notification settings - Fork 111
[storage] Prevent panics from user inputs to pub
functions
#1847
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
base: main
Are you sure you want to change the base?
Conversation
Deploying monorepo with
|
Latest commit: |
cd9a635
|
Status: | ✅ Deploy successful! |
Preview URL: | https://d41824d4.monorepo-eu0.pages.dev |
Branch Preview URL: | https://danlaine-panic-to-error.monorepo-eu0.pages.dev |
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #1847 +/- ##
==========================================
+ Coverage 92.10% 92.16% +0.05%
==========================================
Files 307 307
Lines 79648 79879 +231
==========================================
+ Hits 73362 73617 +255
+ Misses 6286 6262 -24
... and 1 file with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
This PR replaces panics and assertions with error return values. This allows the caller to decide how to handle the error.
There are still some
pub
functions in thecommonware-storage
that may panic, such as those oncommonware-storage::mmr::BitMap
. (The underlying bitmap panics when given invalid values, so we'd have to change that in order to return errors inmmr::BitMap
. Probably not worth it, at least right now.)