@singlephon/rift
Version:
A lightweight micro-framework connecting Blade, Livewire, Alpine.js, and JS seamlessly in Laravel projects.
46 lines (39 loc) • 1.32 kB
JavaScript
import {RiftError} from "./rift";
export class MethodNotFoundError extends RiftError {
constructor(method, componentId) {
super(`Method '${method}' not found on component '${componentId}'`, {
code: 'METHOD_NOT_FOUND',
context: { method, componentId }
});
}
}
export class PropertyNotFoundError extends RiftError {
constructor(prop, componentId) {
super(`Property '${prop}' not found on component '${componentId}'`, {
code: 'PROPERTY_NOT_FOUND',
context: { prop, componentId }
});
}
}
export class SyncError extends RiftError {
constructor(prop, componentId) {
super(`Sync failed for '${prop}' on '${componentId}'`, {
code: 'SYNC_ERROR',
context: { prop, componentId }
});
}
}
export class ComponentNotFoundError extends RiftError {
constructor(componentId) {
super(`Component ${componentId} not found`, {
code: 'COMPONENT_NOT_FOUND',
context: { componentId }
});
}
}
export class MemberNotFoundError extends RiftError {
constructor(member, componentId, context) {
super(`Cannot find member '${member}' on Proxy[${context}] in component '${componentId}'`);
this.name = 'MemberNotFoundError';
}
}