refactor: centralize target errors and cache lookups

This commit is contained in:
Peter Steinberger
2026-01-17 04:28:19 +00:00
parent 3efc5e54fa
commit 5fcc9b3244
20 changed files with 185 additions and 68 deletions

View File

@@ -0,0 +1,8 @@
export function missingTargetMessage(provider: string, hint?: string): string {
const suffix = hint ? ` ${hint}` : "";
return `Delivering to ${provider} requires target${suffix}`;
}
export function missingTargetError(provider: string, hint?: string): Error {
return new Error(missingTargetMessage(provider, hint));
}