'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

function sanitise(error) {
    if (error.response) {
        return {
            text: error.response.text,
            status: error.response.status,
            headers: error.response.headers,
            data: error.response.body,
            message: error.message,
            stack: error.stack,
        };
    }
    return {
        message: error.message,
        stack: error.stack,
    };
}

exports.default = sanitise;
exports.sanitise = sanitise;
//# sourceMappingURL=sanitisedError.js.map
