Skip to content
This repository was archived by the owner on Jun 13, 2024. It is now read-only.

Repository files navigation

Rustic Error

Robust and type-safe error management inspired by Rust's Result pattern.

Example

importtype{Result}from"rustic-error";import{ok,error}from"rustic-error";functiondivide(a: number,b: number): Result<number,string>{if(b===0)returnerror("Division by zero");returnok(a/b);}constfoo=divide(1/2);if(foo.ok){console.log("Result",foo.value);}else{console.log("Error",foo.error);}

About

Robust and type-safe error management 🦀

Topics

Resources

Stars

5 stars

Watchers

1 watching

Forks

Contributors

Languages