Handling Client-Side Errors with OpenAPI's TypeScript SDK
with respect to client side development, how are folks handling their errors - namely what to present to the client, what to log etc. for context, there's an internal api at work that i consume for everything thats generated from open-api's typescript sdk. what that means is i get a typesafe api to call instead of manually using fetch or axios, but the sdk uses axios behind the scenes. Ive created a HttpHelper that essentially handles all important http status codes and a few config codes that indicate a configuration or network issue. what this means is that all my service layers now have a rather lengthy list of error types.
consider an auth service layer that exports a login method. i figure the only possible error codes as far as the client is concerned is 400, 403 and 500, maybe consolidate unexpected configuration or network issues into an UnexpectedError of sorts and thats at least 4 error types to catch and provide user friendly errror messages for. am i going about this the right way or am i making things too hard for myself?
consider an auth service layer that exports a login method. i figure the only possible error codes as far as the client is concerned is 400, 403 and 500, maybe consolidate unexpected configuration or network issues into an UnexpectedError of sorts and thats at least 4 error types to catch and provide user friendly errror messages for. am i going about this the right way or am i making things too hard for myself?
