diff options
author | Marius David Wieschollek <passwords.public@mdns.eu> | 2021-11-28 16:20:03 +0300 |
---|---|---|
committer | Marius David Wieschollek <passwords.public@mdns.eu> | 2021-11-28 16:20:03 +0300 |
commit | 3fb0d365dd6abffb9421cc462d1eb99886a99c4e (patch) | |
tree | ed806b90c2a1c8a84bc96ef12b9a8d9044024743 /src/Exception/ResponseContentTypeError.js | |
parent | 8c005e7bfec7c68728c82d39199a5ba28a451de4 (diff) | |
parent | 858cf27a8476174edc006b9e457208c4a0b5f594 (diff) |
Merge branch 'master' into testing
# Conflicts:
# package-lock.json
# package.json
Diffstat (limited to 'src/Exception/ResponseContentTypeError.js')
-rw-r--r-- | src/Exception/ResponseContentTypeError.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Exception/ResponseContentTypeError.js b/src/Exception/ResponseContentTypeError.js new file mode 100644 index 0000000..5594343 --- /dev/null +++ b/src/Exception/ResponseContentTypeError.js @@ -0,0 +1,27 @@ +export default class ResponseContentTypeError extends Error { + + /** + * @returns {String} + */ + get name() { + return 'ResponseContentTypeError'; + } + + /** + * @returns {Response} + */ + get response() { + return this._response; + } + + /** + * @param {String} expectedType + * @param {String} actualType + * @param {Response} response + */ + constructor(expectedType, actualType, response) { + super(`Expected ${expectedType}, got ${actualType}`); + + this._response = response; + } +}
\ No newline at end of file |