Trust-Machines / BNS-V2

MIT License
10 stars 3 forks source link

Unwrap vs. Try vs. Unwrap-panic #20

Closed setzeus closed 4 months ago

setzeus commented 4 months ago

Description

Currently, there are multiple instances where we cover up a nested error that is likely more descriptive by adding a new error such as "ERR_UNWRAP." This is something that I'm very guilty of until recently but when you're calling into a public function that already returns a response/possible error we shouldn't unwrap it & explicitly overwrite the error message with a new one. Instead, we should reveal that nested error response.

Instead of using (unwrap! ...) when unwrapping a function that already returns a response, use (try! ...) instead.

User Stories

Action Items

Open Questions