Skip to content

Commit ce0541d

Browse files
committed
Made exception handling slightly more robust
1 parent dbad0b4 commit ce0541d

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/main/java/org/digitalmediaserver/cast/CastEvent.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,12 @@ public Invoker(@Nonnull CastEventListener listener, @Nonnull CastEvent<?> event)
613613

614614
@Override
615615
public void run() {
616-
listener.onEvent(event);
616+
try {
617+
listener.onEvent(event);
618+
} catch (Exception e) {
619+
LOGGER.error("An unexpected exception occurred while processing event: {}", e.getMessage());
620+
LOGGER.trace("", e);
621+
}
617622
}
618623
}
619624
}

src/main/java/org/digitalmediaserver/cast/Channel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1790,7 +1790,7 @@ public void run() {
17901790
null,
17911791
0L
17921792
);
1793-
} catch (IOException e) {
1793+
} catch (Exception e) {
17941794
LOGGER.warn(
17951795
CAST_API_MARKER,
17961796
"Failed to set the initial interrim volume on {}: {}",
@@ -1816,7 +1816,7 @@ public void run() {
18161816
null,
18171817
0L
18181818
);
1819-
} catch (IOException | InterruptedException e) {
1819+
} catch (Exception e) {
18201820
LOGGER.warn(
18211821
CAST_API_MARKER,
18221822
"Failed to set the initial volume on {}: {}",

0 commit comments

Comments
 (0)