<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Answers to: Exception Handling: How to get the error message</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message</link><description>&lt;p&gt;How can I access the exception message in a exception start process element?&lt;/p&gt;
&lt;p&gt;Original Question (in German only):&lt;/p&gt;
&lt;p&gt;Ich versuche für unsere Studierenden (Unterricht an der ZHAW) eine möglichst generische Fehlerbehandlung aufzuzeigen. Folgendes schwebt mir vor:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Siehe erstes Bild. Pro Prozess füge ich einen Pool 'Fehlerbehandlung' (1) mit einem Lane pro Fehlerquelle hinzu (z.B. 'DB Step Exception) (2)&lt;/li&gt;
&lt;li&gt;In diesem Lane gibt es ein Exception Start-Element (3)&lt;/li&gt;
&lt;li&gt;Innerhalb des Prozesses kann ich nun überall dieses Start-Element als Exception Handling verwenden, wo es passt (4, 5, 6)&lt;/li&gt;
&lt;li&gt;Das Exception Handling selbst soll zunächst einmal darin bestehen, eine aussagekräftige Fehlermeldung anzuzeigen. Hierfür habe ich einen prozessübergreifenden Subprozess 'DisplayErrorPage' erzeugt (zweites Bild)&lt;/li&gt;
&lt;li&gt;Innerhalb dieses Subprozesses möchte ich nun in Abhängigkeit des aufgetretenen Java-Fehlers (siehe zum Beispiel drittes Bild) über eine unterschiedliche Fehlermeldung reagieren. &lt;strong&gt;Zu diesem Zweck müsste ich aber programmatisch irgendwie auf die Error Message (z.B. drittes Bild) zugreifen können. Wie kann ich dies bewerkstelligen?&lt;/strong&gt; Ich vermutete zunächst, dass dies ein Objekt in der ivy-Hierarchie ist, fand aber nichts.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Ich wäre sehr froh um eine Antwort bis 13.11. 12 Uhr, damit ich rechtzeitig ein Video für die Studierenden erstellen kann.&lt;/p&gt;
&lt;p&gt;&lt;img alt="A" src="/upfiles/A.png"&gt;
&lt;img alt="B" src="/upfiles/B.png"&gt;
&lt;img alt="C" src="/upfiles/C.png"&gt;&lt;/p&gt;</description><atom:link href="https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 12 Nov 2013 13:01:01 -0500</lastBuildDate><item><title>Comment by Björn on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#73</link><description>&lt;p&gt;Hi Reto&lt;/p&gt;
&lt;p&gt;Thanks for your explanation. I will work with the limitation and I am looking forward to the improvement.&lt;/p&gt;
&lt;p&gt;Björn&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Tue, 12 Nov 2013 13:01:01 -0500</pubDate><guid>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#73</guid></item><item><title>Comment by Reto Weiss on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#71</link><description>&lt;p&gt;Hi Björn&lt;/p&gt;
&lt;p&gt;Unfortunately it is at the moment not possible to access the exception object itself. Only the exception message is available. &lt;/p&gt;
&lt;p&gt;It is also not possible to get a log entry object for the exception because on the server the log is written to a file an not kept in memory as it is on the designer runtime log.&lt;/p&gt;
&lt;p&gt;We know that this is a shortcoming of Xpert.ivy. We plan to improve exception handling in one of the upcoming releases.&lt;/p&gt;
&lt;p&gt;Regards &lt;/p&gt;
&lt;p&gt;Reto&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Tue, 12 Nov 2013 09:38:46 -0500</pubDate><guid>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#71</guid></item><item><title>Comment by Björn on Reto Weiss's answer</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#70</link><description>&lt;p&gt;Dear Reto&lt;/p&gt;
&lt;p&gt;Thanks for your answer. It works, but I only get the message without details. I would like to get the whole exception object from the runtime log to be flexible enough. But I don't know, how to get this logEntry. There are so many entries, when I search for 'log' in the Data Type Browser - which class to choose (ch.ivyteam.log!? org.apache.log4j!?) and how to use?&lt;/p&gt;
&lt;p&gt;Kind regards
Björn&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Björn</dc:creator><pubDate>Tue, 12 Nov 2013 09:22:59 -0500</pubDate><guid>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#70</guid></item><item><title>Answer by Reto Weiss</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message/69</link><description>&lt;p&gt;In the inscription maks of the process element exception start a variable called &lt;code&gt;exception&lt;/code&gt; is available that contains the error message. You can assign the variable to a field in your process data as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;out.errorMessage = exception;
&lt;/code&gt;&lt;/pre&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 11 Nov 2013 16:54:18 -0500</pubDate><guid>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message/69</guid></item><item><title>Comment by Reto Weiss on Björn's question</title><link>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#68</link><description>&lt;p&gt;Dear Björn&lt;/p&gt;
&lt;p&gt;Please write questions in english so that users that don't understand german also can read and search it.&lt;/p&gt;
&lt;p&gt;Regards&lt;/p&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Reto Weiss</dc:creator><pubDate>Mon, 11 Nov 2013 16:51:31 -0500</pubDate><guid>https://answers.axonivy.com/questions/67/exception-handling-how-to-get-the-error-message#68</guid></item></channel></rss>