Skip to main content

Overview

Decorator errors are thrown during class decoration when metadata validation fails or when hook targets reference methods that don’t exist. Both are internal errors that indicate a developer configuration issue.

Error Reference

InvalidDecoratorMetadataError

Thrown when a decorator (e.g., @App, @Plugin, @FrontMcp) receives invalid metadata for a specific field.
PropertyTypeValue
codestringINVALID_DECORATOR_METADATA
statusCodenumber500
isPublicbooleanfalse
new InvalidDecoratorMetadataError(decoratorName: string, field: string, details: string)
Example:
import { InvalidDecoratorMetadataError } from '@frontmcp/sdk';

throw new InvalidDecoratorMetadataError('App', 'name', 'must be a non-empty string');
// "@App invalid metadata for "name": must be a non-empty string"

HookTargetNotDefinedError

Thrown when a hook references a target method that is not defined on the class.
PropertyTypeValue
codestringHOOK_TARGET_NOT_DEFINED
statusCodenumber500
isPublicbooleanfalse
new HookTargetNotDefinedError(method: string)
Example:
import { HookTargetNotDefinedError } from '@frontmcp/sdk';

throw new HookTargetNotDefinedError('onBeforeExecute');
// "Hook target method "onBeforeExecute" is not defined"