"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseTwilioError = exports.isTwilioErrorResponse = void 0;
const isTwilioErrorResponse = (data) => {
    return typeof (data === null || data === void 0 ? void 0 : data.moreInfo) === 'string';
};
exports.isTwilioErrorResponse = isTwilioErrorResponse;
const parseTwilioError = (error) => {
    const category = 'BAD_REQUEST';
    const message = `${error.code}: ${error.message} (${error.moreInfo})`;
    return {
        date: new Date().toISOString(),
        text: {
            en: message,
        },
        error: {
            category,
            message,
        },
    };
};
exports.parseTwilioError = parseTwilioError;
//# sourceMappingURL=errors.js.map