Added parameter '--throw-exception', which can not be specified togheter...#31
Open
mgor wants to merge 1 commit into
Open
Added parameter '--throw-exception', which can not be specified togheter...#31mgor wants to merge 1 commit into
mgor wants to merge 1 commit into
Conversation
…ter with '--rna', that will remove the catch-exception code added the epilogue code if '--rna' isn't specified. This feature, in combination with using Popen() instead of call(), will make it possible to catch errors in the RNA code, when not specifying '--rna', which otherwise would go unnoticed.
|
I do need such kind of feature. The ribosome do not output any error information when the py has problem. It's quite hard to trace the problem. I just generate rna file then run in separate for error information. |
eeyrw
added a commit
to eeyrw/ribosome
that referenced
this pull request
Jan 6, 2016
sustrik#31 Make a few modification to run with python3
Contributor
Author
|
In my use case, I had around 20 dna files representing a section in a big configuration file. The configuration is built using make, |
Contributor
Author
|
Dammit, my son manage to send before I could finish. ...make. Without this fix there wouldn't be any indication on why make couldn't build the file. It would just silently die. |
Owner
|
Uh. Sorry for the delay. I see that GitHub reports merge conflicts for this patch. Would you give it a look? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consider the following DNA file:
It contains a reference to an undefined python variable called
name. When generating the output, there's nothing:When adding
--rnaand executing the resulting code it's quite clear the problem is a variable that isn't defined:To fix this, and not break backwards compatibility I added a new parameter
--throw-exception(couldn't come up with a better name...) which basically works as--rnabut writing the RNA code to stdout instead. When specifying the new parameter, the try-catch-exception code parts will not be added to the generated RNA code. The parameter can not be specified at the same time as--rna(mutually exclusive):The new parameter, in combination with using
subprocess.Popen()instead ofsubprocess.call()makes it possible to readstderrfor any error messages and display them:All "legacy" tests passed!