I'm working around this by using the interceptor, below, but all it provides
is the line number and column number.  I'm thinking it'd be reasonable to
submit an enhancement request via the CXF jira. 

public class UnmarshallingFaultInterceptor extends FaultOutInterceptor {        
        @Override
        public void handleMessage(Message message) throws Fault {
                                
                Fault f = (Fault)message.getContent(Exception.class);
        if (f == null) {
            return;
        }

        Throwable cause = f.getCause();
        if (cause == null) {
            return;
        }
        String result=cause.toString();
        
        if (cause instanceof UnmarshalException  &&  ((UnmarshalException)
cause).getLinkedException() != null) {
                UnmarshalException un=(UnmarshalException) cause;     
                String error = un.getLinkedException().toString();
                if (error.contains("lineNumber:")) {
                        error="lineNumber:" + StringUtils.substringAfter(error, 
"lineNumber:");
                }               
                result="Unable to parse invalid data: " + error;
                f.setMessage(result);
        }       
        
      
}







--
View this message in context: 
http://cxf.547215.n5.nabble.com/Unmarshalling-error-content-usability-tp5755169p5755313.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to