import { PlatformException } from '../../exceptions'; import type { PropertyMetadata } from '../types'; export class PropertyException extends PlatformException { constructor( msg: string, details: { propertyMetadata: PropertyMetadata; preparedKey: string }, cause?: unknown, ) { super('CONFIG:PROPERTY', msg, { details, cause, }); } static fromError( err: any, details: { propertyMetadata: PropertyMetadata; preparedKey: string }, ): PropertyException { return new PropertyException( err instanceof Error ? `${details.preparedKey}: ${err.message}` : 'UNKNOWN ERROR', details, err, ); } }