Re: What's the api to fail a build

2018-08-14 Thread Jesse Glick
On Tue, Aug 14, 2018 at 11:43 AM Michael Fowler
 wrote:
> FATAL: execution failed

I do not recognize where this message line is coming from.

Throwing an `AbortException` is the correct response to a foreseeable,
user-level error condition. It should not be displayed as a stack
trace.

>From a full-text search of @jenkinsci I would look first at

https://github.com/jenkinsci/windows-exe-runner-plugin/blob/813facfd3b4482ddd7492e0c904c957e18a45257/src/main/java/org/jenkinsci/plugins/windows_exe_runner/ExeBuilder.java#L244

which appears wrong. All the `catch` blocks (lines 242, 246, and 254)
should be deleted.

If you are working on some other code and still having problems,
narrow down your issue to a minimal reproducible test case (e.g., a
small plugin adding a Pipeline step) and file a bug report.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CANfRfr21zjLF5%3DdwTXQj2ye%2B1tHs3m%2B90mr6JRYjymnWK5enYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What's the api to fail a build

2018-08-14 Thread Daniel Beck


> On 14. Aug 2018, at 05:34, Michael Fowler  wrote:
> 
>  It's in a pipeline. No exception was thrown, that line was removed. The 
> pipeline stopped on the next line. I checked the source for that plugin, it 
> throws an exception. There's got to be a better way than having a stack trace 
> in the build log.

Oops -- read the diff the wrong way, since throwing AbortException is the 
recommended way to do something like this. Could you provide more context about 
the stack trace?


-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/C18B5A57-A565-46A6-B951-230747192FB2%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


Re: What's the api to fail a build

2018-08-13 Thread Michael Fowler
Hey Dan,
 It's in a pipeline. No exception was thrown, that line was removed. The
pipeline stopped on the next line. I checked the source for that plugin, it
throws an exception. There's got to be a better way than having a stack
trace in the build log.

On Mon, Aug 13, 2018, 9:00 PM Daniel Beck  wrote:

>
> > On 14. Aug 2018, at 01:26, Michael Fowler 
> wrote:
> >
> >  I made the change shown below to remove an ugly stack trace from the
> log. However, now the build status doesn't get set to failure. Whats the
> best way to fail the build without throwing AbbortException?
> >
>
> This should work, unless you're in a Pipeline and the exception gets
> caught. Could that be the problem?
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Jenkins Developers" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/jenkinsci-dev/swm_sgA1eGg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> jenkinsci-dev+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-dev/129954F1-8976-4BC2-B02E-40E80EB9AA70%40beckweb.net
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/CADj6zs7JuwzRpvbb--1ot%2BjodV2P_v1sr-vhrFXhbMWrkuAbYw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: What's the api to fail a build

2018-08-13 Thread Daniel Beck


> On 14. Aug 2018, at 01:26, Michael Fowler  wrote:
> 
>  I made the change shown below to remove an ugly stack trace from the log. 
> However, now the build status doesn't get set to failure. Whats the best way 
> to fail the build without throwing AbbortException?
> 

This should work, unless you're in a Pipeline and the exception gets caught. 
Could that be the problem?

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/129954F1-8976-4BC2-B02E-40E80EB9AA70%40beckweb.net.
For more options, visit https://groups.google.com/d/optout.


What's the api to fail a build

2018-08-13 Thread Michael Fowler
Hi All,
 I made the change shown below to remove an ugly stack trace from the log. 
However, now the build status doesn't get set to failure. Whats the best 
way to fail the build without throwing AbbortException?

[image: abort exception.png] 



-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-dev+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-dev/abda7b50-e307-466b-aaff-dab7e2f0d463%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.