mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
Trying to catch error
This commit is contained in:
parent
6d4988c46b
commit
7298428686
1 changed files with 7 additions and 1 deletions
|
|
@ -39,11 +39,17 @@ async function uploadCsvToS3({
|
|||
file: File;
|
||||
}) {
|
||||
try {
|
||||
await fetch(presignedUrl, {
|
||||
const response = await fetch(presignedUrl, {
|
||||
method: "PUT",
|
||||
body: file,
|
||||
headers: { "Content-Type": "text/csv" },
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
console.error(response.text);
|
||||
console.error(response);
|
||||
throw new Error("Network response was not ok");
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
throw new Error("Upload failed.");
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue