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
4 lines
132 B
TypeScript
4 lines
132 B
TypeScript
export function getErrorMessage(error: any, fallback: string) {
|
|
return error?.data?.statusMessage || error?.message || fallback
|
|
}
|