diff --git a/src/lib/strings.ts b/src/lib/strings.ts index 6758e298..77d8298a 100644 --- a/src/lib/strings.ts +++ b/src/lib/strings.ts @@ -198,7 +198,11 @@ export function enforceLen(str: string, len: number): string { 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)) { return 'Unable to connect. Please check your internet connection and try again.' }