From 08d38c219df4f005b6cd060b1df7292410fdcb8e Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 3 Jan 2023 11:08:29 -0600 Subject: [PATCH] Fix bug in error handling --- src/lib/strings.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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.' }