"use strict";
// SPDX-License-Identifier: Apache-2.0
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateBondKpiLinkedRateCommandError = void 0;
const CommandError_1 = require("../../../error/CommandError");
const BaseError_1 = __importDefault(require("../../../../../../core/error/BaseError"));
class CreateBondKpiLinkedRateCommandError extends CommandError_1.CommandError {
    constructor(error) {
        const errorCode = CreateBondKpiLinkedRateCommandError.mapErrorToCode(error);
        const msg = `An error occurred while creating the bond kpi linked rate: ${error.message}`;
        super(msg, errorCode);
    }
    static mapErrorToCode(error) {
        if (error instanceof BaseError_1.default) {
            return error.errorCode;
        }
        return undefined;
    }
}
exports.CreateBondKpiLinkedRateCommandError = CreateBondKpiLinkedRateCommandError;
