/**
 * 路由错误类型定义
 */ import { FrameworkError, ErrorSeverity, ErrorType } from "../../../utils/errors";
/**
 * 路由错误代码
 */ export var RouterErrorCode = /*#__PURE__*/ function(RouterErrorCode) {
    /**
   * 路由未初始化
   */ RouterErrorCode["ROUTER_NOT_INITIALIZED"] = "ROUTER_NOT_INITIALIZED";
    /**
   * 路由配置错误
   */ RouterErrorCode["ROUTER_CONFIG_ERROR"] = "ROUTER_CONFIG_ERROR";
    /**
   * 路由未找到
   */ RouterErrorCode["ROUTE_NOT_FOUND"] = "ROUTE_NOT_FOUND";
    /**
   * 路由导航失败
   */ RouterErrorCode["ROUTE_NAVIGATION_FAILED"] = "ROUTE_NAVIGATION_FAILED";
    /**
   * 路由权限不足
   */ RouterErrorCode["ROUTE_PERMISSION_DENIED"] = "ROUTE_PERMISSION_DENIED";
    /**
   * 路由组件加载失败
   */ RouterErrorCode["ROUTE_COMPONENT_LOAD_FAILED"] = "ROUTE_COMPONENT_LOAD_FAILED";
    /**
   * 路由转换失败
   */ RouterErrorCode["ROUTE_TRANSFORM_FAILED"] = "ROUTE_TRANSFORM_FAILED";
    return RouterErrorCode;
}({});
/**
 * 路由错误
 */ export class RouterError extends FrameworkError {
    constructor(message, code, severity = ErrorSeverity.MEDIUM, cause, context){
        super(message, ErrorType.RUNTIME, severity, {
            code,
            originalError: cause,
            context: context || {}
        });
        this.name = 'RouterError';
    }
}
/**
 * 创建路由错误
 */ export function createRouterError(message, code, severity, cause, context) {
    return new RouterError(message, code, severity, cause, context);
}

//# sourceMappingURL=RouterError.js.map