Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.mdns.eu/nextcloud/passwords-client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/Exception/ResponseDecodingError.js')
-rw-r--r--src/Exception/ResponseDecodingError.js40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/Exception/ResponseDecodingError.js b/src/Exception/ResponseDecodingError.js
new file mode 100644
index 0000000..278da73
--- /dev/null
+++ b/src/Exception/ResponseDecodingError.js
@@ -0,0 +1,40 @@
+export default class ResponseDecodingError extends Error {
+
+ /**
+ * @returns {String}
+ */
+ get name() {
+ return 'ResponseDecodingError';
+ }
+
+ /**
+ * @returns {Response}
+ */
+ get response() {
+ return this._response;
+ }
+
+ /**
+ * @returns {Error}
+ */
+ get error() {
+ return this._error;
+ }
+
+ /**
+ * @param {Response} response
+ * @param {Error} error
+ * @param {String} message
+ */
+ constructor(response, error, message = '') {
+
+ if(message.length === 0) {
+ message = error.message;
+ }
+
+ super(message);
+
+ this._response = response;
+ this._error = error;
+ }
+} \ No newline at end of file