refactor: centralize target errors and cache lookups
This commit is contained in:
8
src/infra/outbound/target-errors.ts
Normal file
8
src/infra/outbound/target-errors.ts
Normal 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));
|
||||
}
|
||||
Reference in New Issue
Block a user