fix: some error handling (#3190)
Maintain Release Merge PR / update-release-pr (push) Has been cancelled
Notify HeyPuter / notify (push) Has been cancelled
release-please / release-please (push) Has been cancelled

This commit is contained in:
Daniel Salazar
2026-05-31 18:58:27 -07:00
committed by GitHub
parent 86f80b29c0
commit 6d2f277ce2
2 changed files with 16 additions and 7 deletions
@@ -146,7 +146,10 @@ export class ImageGenerationDriver extends PuterDriver {
await this.#assertWriteAccess(actor, resolvedOutputPath);
}
let modelId = args.model?.trim().toLowerCase();
let modelId =
typeof args.model === 'string'
? args.model.trim().toLowerCase()
: undefined;
let intendedProvider =
args.provider ?? (Context.get('driverName') as string | undefined);
+12 -6
View File
@@ -1704,8 +1704,10 @@ export class FSEntryStore extends PuterStore {
for (const entry of userEntries) {
const parentEntry = parentByPath.get(entry.parentPath);
if (!parentEntry) {
throw new Error(
`Failed to resolve parent directory for ${entry.targetPath}`,
throw new HttpError(
404,
`Parent directory not found for ${entry.targetPath}`,
{ legacyCode: 'dest_does_not_exist' },
);
}
@@ -1857,8 +1859,10 @@ export class FSEntryStore extends PuterStore {
for (const entry of insertChunk) {
const parentEntry = parentByPath.get(entry.parentPath);
if (!parentEntry) {
throw new Error(
`Failed to resolve parent directory for ${entry.targetPath}`,
throw new HttpError(
404,
`Parent directory not found for ${entry.targetPath}`,
{ legacyCode: 'dest_does_not_exist' },
);
}
@@ -1989,8 +1993,10 @@ export class FSEntryStore extends PuterStore {
for (const entry of racedCandidates) {
const parentEntry = parentByPath.get(entry.parentPath);
if (!parentEntry) {
throw new Error(
`Failed to resolve parent directory for ${entry.targetPath}`,
throw new HttpError(
404,
`Parent directory not found for ${entry.targetPath}`,
{ legacyCode: 'dest_does_not_exist' },
);
}
const existing = racedExistingByPath.get(entry.targetPath);