UNPKG

glpi-client

Version:
22 lines (21 loc) 698 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class GlpiResponseException extends Error { constructor(error) { super(); this.code = error.code; if (error.response) { this.statusCode = error.response.status; this.statusText = error.response.statusText; if (Array.isArray(error.response.data)) { const [reason, message] = error.response.data; this.reason = reason; this.message = message; } } if (!this.message) { this.message = error.message; } } } exports.GlpiResponseException = GlpiResponseException;