Improve connectivity-issue error message
parent
4ae6fbd3c8
commit
b6705fbbaa
|
@ -98,6 +98,9 @@ export function enforceLen(str: string, len: number): string {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function cleanError(str: string): string {
|
export function cleanError(str: string): string {
|
||||||
|
if (str.includes('Network request failed')) {
|
||||||
|
return 'Unable to connect. Please check your internet connection and try again.'
|
||||||
|
}
|
||||||
if (str.startsWith('Error: ')) {
|
if (str.startsWith('Error: ')) {
|
||||||
return str.slice('Error: '.length)
|
return str.slice('Error: '.length)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue