mitre / tir

LM + MITRE SAF project
Other
6 stars 0 forks source link

Consider transitioning to using 'Result' types where possible #13

Open Amndeep7 opened 3 months ago

Amndeep7 commented 3 months ago

Currently we handle errors, validation/assertion failures, and successes in a variety of different ways. Sometimes we return {result: "Success"}, log + throw error up the stack, and/or {success: false, error: "this failed for some reason"}. I think we could become more consistent about things while using a Result type.

Interesting articles/projects:

https://imhoff.blog/posts/using-results-in-typescript https://github.com/vultix/ts-results