<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: How to get root cause of BpmException</title><link>https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception</link><description>&lt;p&gt;Hi all&lt;/p&gt;
&lt;p&gt;In the exception handling of new ivy (6.0) we have a new term that is BpmError, i'm catching it but now i want to know what is the rootcause of that exception, so how can i get it from BpmError. Here is the stacktrace of exception:
&lt;img alt="alt text" src="http://answers.axonivy.com/upfiles/Untitled_nUduUtM.png"&gt;&lt;/p&gt;
&lt;p&gt;The read box is the root cause actually that i want to get it out.&lt;/p&gt;
&lt;p&gt;Is there any way?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception" rel="self"></atom:link><language>en</language><lastBuildDate>Thu, 08 Dec 2016 14:49:25 -0500</lastBuildDate><item><title>Answer by Flavio Sadeghi</title><link>https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception/2260</link><description>&lt;p&gt;The method error.getTechnicalCause() returns the origin thrown exception in the Process Engine. To get the 'root' exception call the method Throwable.getCause() as many times as necessary...&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;public class BpmErrorUtils {
    public static Throwable getRootCause(BpmError bpmError) {
        Throwable origin = bpmError.getTechnicalCause();
        Throwable parent = origin.getCause();
        while (parent != null) {
            origin = parent;
            parent = origin.getCause();
        }
        return origin;
    }
}
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Flavio Sadeghi</dc:creator><pubDate>Thu, 08 Dec 2016 14:49:25 -0500</pubDate><guid>https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception/2260</guid></item><item><title>Answer by Reguel Wermelinger</title><link>https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception/2250</link><description>&lt;pre&gt;&lt;code&gt;error.getTechnicalCause()
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reguel Wermelinger</dc:creator><pubDate>Wed, 07 Dec 2016 13:22:08 -0500</pubDate><guid>https://answers.axonivy.com/questions/2249/how-to-get-root-cause-of-bpmexception/2250</guid></item></channel></rss>