UNPKG

@baseplate-dev/sync

Version:

Library for syncing Baseplate descriptions

39 lines 1.29 kB
/** * Error thrown when a conflict is detected in the generator output */ export class ConflictDetectedError extends Error { constructor(relativePath) { super(`Conflict detected in ${relativePath}. Please fix the conflict and try again.`); this.name = 'ConflictDetectedError'; } } /** * Error thrown when there is an error formatting the generator output */ export class FormatterError extends Error { cause; fileContents; outputRelativePath; constructor(cause, fileContents, outputRelativePath) { super(`Error formatting ${outputRelativePath}: ${String(cause)}`); this.cause = cause; this.fileContents = fileContents; this.outputRelativePath = outputRelativePath; this.name = 'FormatterError'; } } /** * Error thrown when there is an error preparing the generator files */ export class PrepareGeneratorFilesError extends Error { causes; constructor(causes) { super(`Error preparing generator files (showing first 10): ${causes .slice(0, 10) .map(({ relativePath, cause }) => `${relativePath}: ${String(cause)}`) .join('\n')}`); this.causes = causes; this.name = 'PrepareGeneratorFilesError'; } } //# sourceMappingURL=errors.js.map