Skip to content

Commit

Permalink
Remove unnecessary try catch
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-Matsuoka authored and andrewazores committed Dec 11, 2024
1 parent 4daead9 commit 8d64901
Showing 1 changed file with 13 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,21 @@ public LongRunningRequestGenerator() {}

@ConsumeEvent(value = ARCHIVE_ADDRESS, blocking = true)
public void onMessage(ArchiveRequest request) {
logger.trace("Job ID: " + request.getId() + " submitted.");
try {
logger.trace("Job ID: " + request.getId() + " submitted.");
try {
String rec = recordingHelper.archiveRecording(request.recording, null, null).name();
logger.trace("Recording archived, firing notification");
bus.publish(
MessagingServer.class.getName(),
new Notification(
ARCHIVE_RECORDING_SUCCESS,
Map.of("jobId", request.getId(), "recording", rec)));
} catch (Exception e) {
logger.warn("Archiving failed");
bus.publish(
MessagingServer.class.getName(),
new Notification(ARCHIVE_RECORDING_FAIL, Map.of("jobId", request.getId())));
throw new CompletionException(e);
}
String rec = recordingHelper.archiveRecording(request.recording, null, null).name();
logger.trace("Recording archived, firing notification");
bus.publish(
MessagingServer.class.getName(),
new Notification(
ARCHIVE_RECORDING_SUCCESS,
Map.of("jobId", request.getId(), "recording", rec)));
} catch (Exception e) {
logger.warn("Exception thrown while servicing request: ", e);
logger.warn("Archiving failed");
bus.publish(
MessagingServer.class.getName(),
new Notification(ARCHIVE_RECORDING_FAIL, Map.of("jobId", request.getId())));
throw new CompletionException(e);
}
}

Expand Down

0 comments on commit 8d64901

Please sign in to comment.