Catch and log unhandled exceptions

pull/3/head
Bertrik Sikken 2019-05-03 15:39:35 +02:00
rodzic 83b2973591
commit 1ce025f9e0
2 zmienionych plików z 6 dodań i 0 usunięć

Wyświetl plik

@ -123,6 +123,9 @@ public final class TtnHabBridge {
LOG.warn("JSON unmarshalling exception '{}' for {}", e.getMessage(), textMessage);
} catch (DecodeException e) {
LOG.warn("Payload decoding exception: {}", e.getMessage());
} catch (Exception e) {
LOG.trace("Caught unhandled exception", e);
LOG.error("Caught unhandled exception", e.getMessage());
}
}

Wyświetl plik

@ -140,6 +140,9 @@ public final class HabitatUploader {
LOG.info("Result payload telemetry doc {}: {}", docId, response);
} catch (IOException e) {
LOG.warn("Caught exception: {}", e.getMessage());
} catch (Exception e) {
LOG.trace("Caught unhandled exception", e);
LOG.error("Caught unhandled exception", e.getMessage());
}
}