Skip to content

Commit

Permalink
[JENKINS-13378] Add FINER logging of XML when XPath handling fails.
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasvandoren committed Apr 9, 2012
1 parent 668a0cc commit e1a1d3f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/Api.java
Expand Up @@ -44,6 +44,8 @@
import java.io.StringReader;
import java.io.StringWriter;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* Used to expose remote access API for ".../api/"
Expand Down Expand Up @@ -139,7 +141,8 @@ public void doXml(StaplerRequest req, StaplerResponse rsp,
}

} catch (DocumentException e) {
throw new IOException2("Failed to do XPath/wrapper handling.",e);
LOGGER.log(Level.FINER, "Failed to do XPath/wrapper handling. XML is as follows:"+sw, e);
throw new IOException2("Failed to do XPath/wrapper handling. Turn on FINER logging to view XML.",e);
}

OutputStream o = rsp.getCompressedOutputStream(req);
Expand Down Expand Up @@ -188,5 +191,6 @@ public void doPython(StaplerRequest req, StaplerResponse rsp) throws IOException
rsp.serveExposedBean(req,bean, Flavor.PYTHON);
}

private static final Logger LOGGER = Logger.getLogger(Api.class.getName());
private static final ModelBuilder MODEL_BUILDER = new ModelBuilder();
}

0 comments on commit e1a1d3f

Please sign in to comment.