protected void handleXMLStreamException(XMLStreamException e, boolean read) { StringBuilder sb = handleExceptionStart(e); handleExceptionEnd(e, sb.toString(), read); }
protected void handleXMLStreamException(XMLStreamException e, boolean read) { StringBuilder sb = handleExceptionStart(e); handleExceptionEnd(e, sb.toString(), read); }
protected void handleJAXBException(JAXBException e, boolean read) { StringBuilder sb = handleExceptionStart(e); Throwable linked = e.getLinkedException(); if (linked != null && linked.getMessage() != null) { if (read && linked instanceof XMLStreamException && linked.getMessage().startsWith("Maximum Number")) { throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413)); } sb.append(linked.getMessage()).append(". "); } Throwable t = linked != null ? linked : e.getCause() != null ? e.getCause() : e; String message = new org.apache.cxf.common.i18n.Message("JAXB_EXCEPTION", BUNDLE, sb.toString()).toString(); handleExceptionEnd(t, message, read); }
protected void handleJAXBException(JAXBException e, boolean read) { StringBuilder sb = handleExceptionStart(e); Throwable linked = e.getLinkedException(); if (linked != null && linked.getMessage() != null) { Throwable cause = linked; while (read && cause != null) { if (cause instanceof XMLStreamException && cause.getMessage().startsWith("Maximum Number")) { throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413)); } if (cause instanceof DepthExceededStaxException) { throw ExceptionUtils.toWebApplicationException(null, JAXRSUtils.toResponse(413)); } cause = cause.getCause(); } String msg = linked.getMessage(); if (sb.lastIndexOf(msg) == -1) { sb.append(msg).append(". "); } } Throwable t = linked != null ? linked : e.getCause() != null ? e.getCause() : e; String message = new org.apache.cxf.common.i18n.Message("JAXB_EXCEPTION", BUNDLE, sb.toString()).toString(); handleExceptionEnd(t, message, read); }