refactor: centralize validation, error handling, and formatting logic
Extract shared auth logic and validation rules to shared/auth.ts Introduce utility functions for HTTP errors and user input parsing Standardize error messages and date formatting across the app
This commit is contained in:
3
app/utils/errors.ts
Normal file
3
app/utils/errors.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
export function getErrorMessage(error: any, fallback: string) {
|
||||
return error?.data?.statusMessage || error?.message || fallback
|
||||
}
|
||||
Reference in New Issue
Block a user