Skip to content

Commit

Permalink
Merge pull request #141 from DemocracyDevelopers/140-use-conventional…
Browse files Browse the repository at this point in the history
…-error-handling-in-getassertions-endpoint

140 use conventional error handling in getassertions endpoint
  • Loading branch information
vteague authored Jul 2, 2024
2 parents 19746b9 + 679bdd7 commit dcbc281
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,17 +135,18 @@ public String endpointBody(final Request the_request, final Response the_respons
the_response.header("Content-Disposition", "attachment; filename*=UTF-8''assertions.zip");

ok(the_response);
return my_endpoint_result.get();

} catch (URISyntaxException | MalformedURLException e) {
final String msg = "Bad configuration of raire-service url: " + raireUrl + ". Fix the config file.";
LOGGER.error(String.format("%s %s %s", prefix, msg, e.getMessage()));
throw new RuntimeException(msg);
serverError(the_response, msg);
} catch (IOException e) {
final String msg = "Error creating zip file.";
LOGGER.error(String.format("%s %s %s", prefix, msg, e.getMessage()));
throw new RuntimeException(e);
serverError(the_response, msg);
}

return my_endpoint_result.get();
}

/**
Expand Down

0 comments on commit dcbc281

Please sign in to comment.