/** * Method for accessing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
protected String _buildMessage() { // First: if we have no path info, let's just use parent's definition as is String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
@Override public Iterable<T> apply(final InputStream input) { try (InputStream actual = input) { String text = CharStreams.toString(new InputStreamReader(actual)); return DEFAULT_MAPPER.readValue(text, type); } catch (UnrecognizedPropertyException e) { logger.info("Unrecognized field: {}", e.getMessage()); throw new MocoException(format("Unrecognized field [ %s ], please check!", e.getPropertyName())); } catch (JsonMappingException e) { logger.info("{} {}", e.getMessage(), e.getPathReference()); throw new MocoException(e); } catch (IOException e) { throw new MocoException(e); } } };
/** * Method for accesing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
/** * Method for accesing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
/** * Method for accesing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
/** * Method for accessing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
/** * Method for accesing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
/** * Method for accessing description of path that lead to the * problem that triggered this exception */ public String getPathReference() { return getPathReference(new StringBuilder()).toString(); }
protected String _buildMessage() { /* First: if we have no path info, let's just use parent's * definition as is */ String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
protected String _buildMessage() { // First: if we have no path info, let's just use parent's definition as is String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
protected String _buildMessage() { /* First: if we have no path info, let's just use parent's * definition as is */ String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
protected String _buildMessage() { /* First: if we have no path info, let's just use parent's * definition as is */ String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
protected String _buildMessage() { /* First: if we have no path info, let's just use parent's * definition as is */ String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
protected String _buildMessage() { /* First: if we have no path info, let's just use parent's * definition as is */ String msg = super.getMessage(); if (_path == null) { return msg; } StringBuilder sb = (msg == null) ? new StringBuilder() : new StringBuilder(msg); /* 18-Feb-2009, tatu: initially there was a linefeed between * message and path reference; but unfortunately many systems * (loggers, junit) seem to assume linefeeds are only added to * separate stack trace. */ sb.append(" (through reference chain: "); sb = getPathReference(sb); sb.append(')'); return sb.toString(); }
@Override public T deserialize(JsonNode jsonNode, MessageBuilder messageBuilder) { T deserializedObject = null; try { deserializedObject = objectMapper.readValue(jsonNode.traverse(), clazz); } catch (JsonMappingException e) { messageBuilder.append(new Message(e.getPathReference(), e.getMessage(), Severity.ERROR)); } catch (IOException e) { messageBuilder.append(new Message("", e.getMessage(), Severity.ERROR)); } return deserializedObject; } }
String pathReference = ((JsonMappingException) ex).getPathReference(); if (pathReference != null) { message += " referenced via: " + pathReference;
String pathReference = ((JsonMappingException) ex).getPathReference(); if (pathReference != null) { message += " referenced via: " + pathReference;
String pathReference = ((JsonMappingException) ex).getPathReference(); if (pathReference != null) { message += " referenced via: " + pathReference;
String pathReference = ((JsonMappingException) ex).getPathReference(); if (pathReference != null) { message += " referenced via: " + pathReference;