-
Intent: All fallible operations must return a
Result<T, E>(from neverthrow) instead of throwing or returningnull/undefined. This makes failures explicit in the type system. -
Tagged Errors: Define every custom error as a class using
Data.TaggedError("Name")<Props>. Name each error in PascalCase ending withError. For example:
import { Data } from "effect";
export class InvalidPaymentError extends Data.TaggedError("InvalidPayment")<{