"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseHealthiePatientNotCreatedError = exports.HealthiePatientNotCreated = void 0;
class HealthiePatientNotCreated extends Error {
    constructor(errors) {
        super('Failed to create patient in Healthie.');
        this.name = 'HealthiePatientNotCreated';
        this.errors = errors;
    }
}
exports.HealthiePatientNotCreated = HealthiePatientNotCreated;
const parseHealthiePatientNotCreatedError = (error) => {
    const category = 'BAD_REQUEST';
    const message = JSON.stringify(error, null, 2);
    return {
        date: new Date().toISOString(),
        text: {
            en: message,
        },
        error: {
            category,
            message,
        },
    };
};
exports.parseHealthiePatientNotCreatedError = parseHealthiePatientNotCreatedError;
//# sourceMappingURL=errors.js.map