Skip to content

Commit

Permalink
fix(Android): Catch all exceptions and redirect them to JS (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaslecomte authored Mar 22, 2022
1 parent bd8f797 commit 0a512ee
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions android/src/main/java/com/tradle/react/UdpSockets.java
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,8 @@ public void run() {

try {
client.send(base64String, port, address, callback);
} catch (IllegalStateException ise) {
callback.invoke(UdpErrorUtil.getError(null, ise.getMessage()));
} catch (UnknownHostException uhe) {
callback.invoke(UdpErrorUtil.getError(null, uhe.getMessage()));
} catch (IOException ioe) {
// an exception occurred
callback.invoke(UdpErrorUtil.getError(null, ioe.getMessage()));
} catch (Exception exception) {
callback.invoke((UdpErrorUtil.getError(null, exception.getMessage())));
}
}
}));
Expand Down

0 comments on commit 0a512ee

Please sign in to comment.