Error Handling and Data Unmarshalling in TypeScript
Hello, how are you doing?
I need some help with Typescript:
Typescript complains on
I need some help with Typescript:
Typescript complains on
Effect.try:typescript: No overload matches this call.
Overload 1 of 2, '(options: { readonly try: LazyArg<Record<string, any>>; readonly catch: (error: unknown) => UnmarshallError; }): Effect<never, UnmarshallError, Record<...>>', gave the following error.
Type '(e: Error) => UnmarshallError' is not assignable to type '(error: unknown) => UnmarshallError'.
Types of parameters 'e' and 'error' are incompatible.
Type 'unknown' is not assignable to type 'Error'.
Overload 2 of 2, '(evaluate: LazyArg<unknown>): Effect<never, unknown, unknown>', gave the following error.
Argument of type '{ try: () => Record<string, any>; catch: (e: Error) => UnmarshallError; }' is not assignable to parameter of type 'LazyArg<unknown>'.
Object literal may only specify known properties, and 'try' does not exist in type 'LazyArg<unknown>'. [2769]