jboss-remoting/jboss-marshalling — pull request #37 by kohsuke (2014-11-11 19:37:37+00:00)
Title: Improving error diagnostics.

In case of non-serializable object, river marshaller tries to print out
the path into the object in question. This is great, but right now the
exception message is rather unhelpful.

See the following example that I just had. The problem is that the field name
is not qualified by the owner class name, so I still can't quite figure out how this object
in question is referenced. This change improves the situation by prepending the field name
by the name of the owning class. In addition, object info is also added wherever possible,
to further improve the diagnostics:

```
java.io.NotSerializableException: org.jenkinsci.plugins.workflow.steps.ExceptionCause
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:890)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:808)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:997)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:679)
at org.jboss.marshalling.river.RiverMarshaller.doWriteFields(RiverMarshaller.java:1062)
at org.jboss.marshalling.river.RiverMarshaller.doWriteSerializableObject(RiverMarshaller.java:1018)
at org.jboss.marshalling.river.RiverMarshaller.doWriteObject(RiverMarshaller.java:884)
at org.jboss.marshalling.AbstractObjectOutput.writeObject(AbstractObjectOutput.java:58)
at org.jboss.marshalling.AbstractMarshaller.writeObject(AbstractMarshaller.java:111)
at org.jenkinsci.plugins.workflow.support.pickles.serialization.RiverWriter.writeObject(RiverWriter.java:128)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:345)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.saveProgram(CpsThreadGroup.java:329)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.run(CpsThreadGroup.java:303)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup.access$000(CpsThreadGroup.java:72)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:184)
at org.jenkinsci.plugins.workflow.cps.CpsThreadGroup$3.call(CpsThreadGroup.java:182)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
at org.jenkinsci.plugins.workflow.cps.CpsVmThread.run(CpsVmThread.java:21)
Caused by: an exception which occurred:
in field a
in field causes
in field stopped
in field body
in field step
in field thread
in field callback
in field returnAddress
in field parent
in field caller
in field parent
in field capture
in field def
in field delegate
in field closures
in object org.jenkinsci.plugins.workflow.cps.CpsThreadGroup@323b082b
```