new error for HTTP responses without stack trace (#1044)

* new error for HTTP responses without stack trace

* lint
This commit is contained in:
Sam Machin
2025-01-16 13:05:17 +00:00
committed by GitHub
parent f71f0ac69a
commit 4dbc7df93d
2 changed files with 12 additions and 3 deletions

View File

@@ -17,8 +17,17 @@ class PlayFileNotFoundError extends NonFatalTaskError {
}
}
class HTTPResponseError extends Error {
constructor(statusCode) {
super('Unexpected HTTP Response');
delete this.stack;
this.statusCode = statusCode;
}
}
module.exports = {
SpeechCredentialError,
NonFatalTaskError,
PlayFileNotFoundError
PlayFileNotFoundError,
HTTPResponseError
};