Skip to content

Commit

Permalink
Log file upload error message to console
Browse files Browse the repository at this point in the history
  • Loading branch information
tillywoodfield committed Jul 9, 2024
1 parent dc8b011 commit 7fa8162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/LocalFilesValidator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
const parallelUpload = (files) => forkJoin(files.map((file) => uploadFile(file, props.workspaceID)));
const uploadFiles = () => {
const handleError = () => {
const handleError = (error) => {
console.error(error);
requestStatus.value = 'error';
};
Expand Down
3 changes: 2 additions & 1 deletion src/utils/api/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ export const uploadFile = async (file, tmpWorkspaceId) => {
const response = await window.fetch(url, { ...getDefaultServicesAPIOptions(), method: 'post', body: uploadData });

if (!response.ok) {
throw new Error('Error uploading file.');
const text = await response.text();
throw new Error(text);
}
return last(response);
};
Expand Down

0 comments on commit 7fa8162

Please sign in to comment.