private T tryParseEvent(final JsonValue jsonValue) { try { return parseEvent(jsonValue); } catch (final JsonParseException | DittoRuntimeException e) { if (system != null) { system.log().error(e, "Could not deserialize Event JSON: '{}'", jsonValue); } else { LOGGER.error("Could not deserialize Event JSON: '{}': {}", jsonValue, e.getMessage()); } return null; } }
private T tryParseEvent(final JsonValue jsonValue) { try { return parseEvent(jsonValue); } catch (final JsonParseException | DittoRuntimeException e) { if (system != null) { system.log().error(e, "Could not deserialize Event JSON: '{}'", jsonValue); } else { LOGGER.error("Could not deserialize Event JSON: '{}': {}", jsonValue, e.getMessage()); } return null; } }
@Nullable private Event tryToCreateEventFrom(final JsonValue json) { try { return createEventFrom(json); } catch (final JsonParseException | DittoRuntimeException e) { final String message = MessageFormat.format("Could not deserialize ThingEvent JSON: ''{0}''", json); if (system != null) { system.log().error(e, message); } else { LOGGER.error(message, e); } return null; } }
@Nullable private Event tryToCreateEventFrom(final JsonValue json) { try { return createEventFrom(json); } catch (final JsonParseException | DittoRuntimeException e) { final String message = MessageFormat.format("Could not deserialize ThingEvent JSON: ''{0}''", json); if (system != null) { system.log().error(e, message); } else { LOGGER.error(message, e); } return null; } }
@Nullable private PolicyEvent tryToCreateEventFrom(final JsonValue json) { try { return createEventFrom(json); } catch (final JsonParseException | DittoRuntimeException e) { final String message = MessageFormat.format("Could not deserialize PolicyEvent JSON: ''{0}''", json); if (system != null) { system.log().error(e, message); } else { LOGGER.error(message, e); } return null; } }
@Nullable private PolicyEvent tryToCreateEventFrom(final JsonValue json) { try { return createEventFrom(json); } catch (final JsonParseException | DittoRuntimeException e) { final String message = MessageFormat.format("Could not deserialize PolicyEvent JSON: ''{0}''", json); if (system != null) { system.log().error(e, message); } else { LOGGER.error(message, e); } return null; } }