Fix bug in error handling

zio/stable
Paul Frazee 2023-01-03 11:08:29 -06:00
parent d262393992
commit 08d38c219d
1 changed files with 5 additions and 1 deletions

View File

@ -198,7 +198,11 @@ export function enforceLen(str: string, len: number): string {
return str return str
} }
export function cleanError(str: string): string { export function cleanError(str: any): string {
if (!str) return str
if (typeof str !== 'string') {
str = str.toString()
}
if (isNetworkError(str)) { if (isNetworkError(str)) {
return 'Unable to connect. Please check your internet connection and try again.' return 'Unable to connect. Please check your internet connection and try again.'
} }