Pweave icon indicating copy to clipboard operation
Pweave copied to clipboard

Option to exit with non-zero status when exception raised

Open jncraton opened this issue 7 years ago • 3 comments

Is it possible to force Pweave to exit with a non-zero exit status when it encounters an exception is raised from a code block?

Often when I'm working on something I'm embedding tests and sanity checks in my code blocks to make sure that things are working properly. It would speed up my coding cycle if I could get immediate feedback that these have failed rather than having to look through the output file.

Is this possible? If not, is this a feature that others might want that I could add as a CLI flag?

jncraton avatar Feb 12 '18 14:02 jncraton

I think by default pweave shall not report exception as raising an exception may be intended behaviour of the code block (e.g. in a tutorial paper).

However I think either CLI flag or chunk option (or both) changing the default behaviour will be useful indeed.

abukaj avatar Feb 13 '18 11:02 abukaj

I agree completely. Sorry I didn't make that clear originally. The default behavior should remain unchanged, but a chunk option and/or CLI flag to adjust this behavior would be nice.

jncraton avatar Feb 13 '18 13:02 jncraton

It is not currently possible. A pull request that implements this options would be nice.

mpastell avatar Feb 13 '18 13:02 mpastell