Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
java error handler
ShlomiW
Hi all,<br />
<br />
I'm looking for an example for a JAVA error handler for birt.<br />
I have founded many examples but I can't reused them in my reports.<br />
<br />
When I tried to write the following code in the "beforeFactory" section.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
try {
reportContext.setPersistentGlobalVariable("newParametersName", parametersName1);
}
catch (IOException e) {
e.printStackTrace();
}
}
</pre>
<br />
I get this error message: <br />
<pre class='_prettyXprint _lang-auto _linenums:0'>invalid catch block condition</pre>
<br />
I have looked but I can't find any reference for why I get this error message.<br />
<br />
Please help my to understand and write good code :-)<br />
Have a great day<br />
Shlomi
Find more posts tagged with
Comments
kclark
I haven't tried it but I think it needs EngineException<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>try {
// Some code
}
catch(EngineException e) {
// Error code
}</pre>
singsing
Try this. I just get the same error today.
try {
// Some code
}
catch(err) {
// Error code
}
ShlomiW
In my reply I ment to quote this comment<br />
<blockquote class='ipsBlockquote' data-author="'kclark'" data-cid="115529" data-time="1364574439" data-date="29 March 2013 - 09:27 AM"><p>
I haven't tried it but I think it needs EngineException<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>try {
// Some code
}
catch(EngineException e) {
// Error code
}</pre></p></blockquote>
<br />
and not the one that I added, sorry for the mess<br />
<br />
<del class='bbc'><blockquote class='ipsBlockquote' data-author="'singsing'" data-cid="115536" data-time="1364577119" data-date="29 March 2013 - 10:11 AM"><p>
Try this. I just get the same error today. <br />
<br />
<br />
try {<br />
// Some code<br />
}<br />
catch(err) {<br />
// Error code<br />
}<br /></p></blockquote></del><br />
<br />
But then what code can I used in order to display my error?<br />
Can I print it to a file? if so can you tell me what in the name of the function that I need to use?<br />
If I can't print the error to file can I display it on the screen? like with an <pre class='_prettyXprint _lang-auto _linenums:0'>echo(error text); [in php]</pre>
or <pre class='_prettyXprint _lang-auto _linenums:0'>alert(error text); [in JavaScript]</pre>
<br />
<br />
I hope that this comment is clear if not please write me back and I would try to explain again.<br />
<br />
Have a great day<br />
Shlomi