* Avoid surfacing errors to the user when it's not critical * Remove now-unused GetAssertionsView * Apply cleanError() consistently * Give a better error message for Upstream Failures (http status 502) * Hide errors in notifications because they're not useful
This commit is contained in:
+4
-1
@@ -198,7 +198,7 @@ export function enforceLen(str: string, len: number, ellipsis = false): string {
|
||||
|
||||
export function cleanError(str: any): string {
|
||||
if (!str) {
|
||||
return str
|
||||
return ''
|
||||
}
|
||||
if (typeof str !== 'string') {
|
||||
str = str.toString()
|
||||
@@ -206,6 +206,9 @@ export function cleanError(str: any): string {
|
||||
if (isNetworkError(str)) {
|
||||
return 'Unable to connect. Please check your internet connection and try again.'
|
||||
}
|
||||
if (str.includes('Upstream Failure')) {
|
||||
return 'The server appears to be experiencing issues. Please try again in a few moments.'
|
||||
}
|
||||
if (str.startsWith('Error: ')) {
|
||||
return str.slice('Error: '.length)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user