Project Files
src / errors.ts
export class DataPluginError extends Error {
public readonly code: string;
constructor(message: string, code: string) {
super(message);
this.name = "DataPluginError";
this.code = code;
}
}
export class CSVParseError extends DataPluginError {
constructor(message: string) {
super(message, "CSV_PARSE_ERROR");
this.name = "CSVParseError";
}
}
export class SchemaNotFoundError extends DataPluginError {
constructor(message: string) {
super(message, "SCHEMA_NOT_FOUND");
this.name = "SchemaNotFoundError";
}
}
export class ValidationError extends DataPluginError {
constructor(message: string) {
super(message, "VALIDATION_ERROR");
this.name = "ValidationError";
}
}
export class NotFoundError extends DataPluginError {
constructor(message: string, code: string = "DB_NOT_FOUND") {
super(message, code);
this.name = "NotFoundError";
}
}
export class FilesystemError extends DataPluginError {
constructor(message: string) {
super(message, "FILESYSTEM_ERROR");
this.name = "FilesystemError";
}
}
export class DuplicateError extends DataPluginError {
constructor(message: string, code: string = "DUPLICATE_DATABASE") {
super(message, code);
this.name = "DuplicateError";
}
}
export class DataPluginConfigError extends DataPluginError {
constructor(message: string, code: string = "CONFIG_ERROR") {
super(message, code);
this.name = "DataPluginConfigError";
}
}