n8n/packages/@n8n/instance-ai/src/errors/folder-resolution.error.ts
Roman Makowiak 9769dacbe3
feat(core): Add folder exploration to Instance AI (#37865)
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 20:52:53 +00:00

18 lines
665 B
TypeScript

import { UserError } from 'n8n-workflow';
import type { FolderResolutionFailure } from '../types';
/**
* A caller named a folder that could not be resolved to exactly one folder.
*
* Thrown instead of degrading silently: a write that lands at the project
* root when the user asked for a folder is the failure folder addressing
* exists to remove. Carries the same `FolderResolutionFailure` the list
* action returns, so tools render both the same way.
*/
export class FolderResolutionError extends UserError {
constructor(readonly folderResolution: FolderResolutionFailure) {
super(`Folder "${folderResolution.requested}" could not be resolved`);
}
}