// SPDX-License-Identifier: Apache-2.0
import { CommandError } from "../../../error/CommandError";
import BaseError from "../../../../../../core/error/BaseError";
export class CreateBondKpiLinkedRateCommandError extends 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) {
            return error.errorCode;
        }
        return undefined;
    }
}
