Open biohackerellie opened 5 months ago
Same here — I'd expect it to use the return type of my onError
function:
.onError(({ code, error }): { code: string } | { code: string, details: ValidationError | string } => { ... })
But even with it explicitly defined here, the error type in the client is just unknown/unknown.
It seems viable to have errors be completely type safe, since the status codes are known (custom errors get registered with .error()), and value could just be the return type of onError...? But I guess you have to account for errors that didn't come from Elysia...?
The Issue
I'm not sure if this is how its supposed to be with treaty 2 but I had proper error types in v1