Skip to content

Commit

Permalink
Add error message
Browse files Browse the repository at this point in the history
  • Loading branch information
lukfor committed Sep 10, 2024
1 parent 5d5f77d commit c91e4a8
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,12 @@ public MutableHttpResponse<InputStream> downloadPublicLink(String hash, String f

String message = String.format("Job: Anonymously downloading file '%s' (hash %s)", filename, hash);
log.info(message);
return downloadService.download(download);

try {
return downloadService.download(download);
} catch (Exception e) {
log.error("Downloading file failed.", e);
throw new JsonHttpStatusException(HttpStatus.NOT_FOUND, "File not found in workspace.");
}
}

@Get("/browse/{hash}/{filename:.+}")
Expand Down

0 comments on commit c91e4a8

Please sign in to comment.