Skip to content

Commit

Permalink
fix: add some visibility on error... (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
Plopix authored Dec 22, 2023
1 parent 1c89d48 commit 5393ddb
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/nine-elephants-pump.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@crystallize/import-utilities': patch
---

Add more visibility on uploading error
4 changes: 2 additions & 2 deletions src/bootstrap-tenant/bootstrapper/items/createFilesInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ export async function createFilesInput(
// Store the values so that we don't re-upload again during import
file.key = uploadResult.key
}
} catch (e) {
} catch (e: any) {
onUpdate({
error: {
code: 'UPLOAD_FAILED',
message: `Could not upload file "${JSON.stringify(file)}"`,
message: `Could not upload file "${JSON.stringify(file)}". Reason: ${e.message ?? 'unknown'}`,
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap-tenant/bootstrapper/items/createImagesInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ export async function createImagesInput(
image.key = uploadResult.key
image.mimeType = uploadResult.mimeType
}
} catch (e) {
} catch (e: any) {
onUpdate({
error: {
code: 'UPLOAD_FAILED',
message: `Could not upload image "${JSON.stringify(image)}"`,
message: `Could not upload image "${JSON.stringify(image)}". Reason: ${e.message ?? 'unknown'}`,
},
})
}
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap-tenant/bootstrapper/items/createVideosInput.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ export async function createVideosInput(
// Store the values so that we don't re-upload again during import
video.key = uploadResult.key
}
} catch (e) {
} catch (e: any) {
onUpdate({
error: {
code: 'UPLOAD_FAILED',
message: `${e} - Could not upload video "${JSON.stringify(video)}"`,
message: `Could not upload video "${JSON.stringify(video)}". Reason: ${e.message ?? 'unknown'}`,
},
})
}
Expand Down

0 comments on commit 5393ddb

Please sign in to comment.