Skip to content

Commit d97d141

Browse files
committed
change error handling
1 parent fcdbe34 commit d97d141

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/design/lib/stores/toast/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,12 @@ const useToastStore = (): ToastStore => {
5050
try {
5151
title = error.response.status.toString()
5252
const errorMessage = await error.response.text()
53-
description = errorMessage.split('\n')[0].split(': ')[1]
53+
description = errorMessage.split('\n')[0]
54+
if (description.includes('Error: ')) {
55+
const splits = description.split(': ')
56+
splits.shift()
57+
description = splits.join()
58+
}
5459
} catch (error) {}
5560
}
5661

0 commit comments

Comments
 (0)