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