// SPDX-License-Identifier: Apache-2.0
import { CommandError } from "../../../error/CommandError";
import BaseError from "../../../../../../core/error/BaseError";
export class CreateBondCommandError extends CommandError {
    constructor(error) {
        const errorCode = CreateBondCommandError.mapErrorToCode(error);
        const msg = `An error occurred while creating the bond: ${error.message}`;
        super(msg, errorCode);
    }
    static mapErrorToCode(error) {
        if (error instanceof BaseError) {
            return error.errorCode;
        }
        return undefined;
    }
}
