Skip to content

Commit

Permalink
new error handling
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Rosenberg <[email protected]>
  • Loading branch information
ItamarYuran and Jonathan-Rosenberg authored Dec 10, 2024
1 parent 2917355 commit 31bff69
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions webui/src/pages/repositories/repository/objects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,12 +255,7 @@ const uploadFile = async (config, repo, reference, path, file, onProgress) => {
const checksum = extractChecksumFromResponse(parsedHeaders);
await staging.link(repo.id, reference.id, fpath, getResp, checksum, file.size, file.type);
} catch(error) {
if (error.status >= 400) {
throw new Error(`Error uploading file: HTTP ${error.status}`);
}
if (error.status === 0) {
throw new Error(`CORS settings error. Check documentation for more info.`);
}
throw new Error(`Error uploading file- ${error.status}${error.response ? `: ${error.response}` : ''}`);
throw error;

Check failure on line 259 in webui/src/pages/repositories/repository/objects.jsx

View workflow job for this annotation

GitHub Actions / Test React App

Unreachable code

Check failure on line 259 in webui/src/pages/repositories/repository/objects.jsx

View workflow job for this annotation

GitHub Actions / Analyze

Unreachable code

Check failure on line 259 in webui/src/pages/repositories/repository/objects.jsx

View workflow job for this annotation

GitHub Actions / Run Linters and Checkers

Unreachable code

Check failure on line 259 in webui/src/pages/repositories/repository/objects.jsx

View workflow job for this annotation

GitHub Actions / Generate code from latest lakeFS app

Unreachable code
}
} else {
Expand Down

0 comments on commit 31bff69

Please sign in to comment.