This commit is contained in:
Александр Тороп
2024-03-30 18:27:37 +03:00
commit 038bf44010
2765 changed files with 293753 additions and 0 deletions

17
node_modules/glpi-api/errors/ServerError.js generated vendored Normal file
View File

@@ -0,0 +1,17 @@
class ServerError extends Error {
constructor(message, code, comment) {
if (message instanceof Error && message.response) {
code = message.response.statusCode;
comment = message.response.body[1];
message = message.response.body[0];
}
super(message);
this.name = this.constructor.name;
Error.captureStackTrace(this, this.constructor);
this.code = code || 500;
this.comment = comment;
}
}
module.exports = ServerError;