mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 04:26:58 +00:00
suppress large error messages from Got
This commit is contained in:
parent
ce08bd1b42
commit
72e95b66a2
1 changed files with 5 additions and 1 deletions
|
@ -101,8 +101,12 @@ export class DownloadService {
|
|||
} catch (e) {
|
||||
if (e instanceof Got.HTTPError) {
|
||||
throw new StatusError(`${e.response.statusCode} ${e.response.statusMessage}`, e.response.statusCode, e.response.statusMessage);
|
||||
} else {
|
||||
} else if (e instanceof Got.RequestError || e instanceof Got.AbortError) {
|
||||
throw new Error(String(e));
|
||||
} else if (e instanceof Error) {
|
||||
throw e;
|
||||
} else {
|
||||
throw new Error(String(e));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue