I'am executing an java script in Hudson server. I want throw new error if the java fail but I dont know how to do it. I want to throw new error because I configured send new email when the enter image description hereerror throw.
Asked
Active
Viewed 47 times
1
-
Are you using Java (as tagged) or JavaScript (as given in the description)? – Stormcloud Dec 21 '15 at 12:56
-
How are you launching your Java application? (Is it a Hudson plug-in or something you call via a script or through maven?) Have you tried using System.exit(1) when your Java application fails? – Stormcloud Dec 23 '15 at 08:58
-
Hi, I use "java -jar" in Hudson task, I dont tried using System.exit(1), do is the solution? – gradski Dec 23 '15 at 16:55
-
Thanks, System.exit(1) is the solution. – gradski Dec 23 '15 at 17:06
1 Answers
0
The solutions is notify to the VM that the process failed, the way is: System.exit(1) (in catch block)

gradski
- 71
- 1
- 2
- 8