-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Output error messages when using execute
from vpype API
#664
Comments
This is a good feature idea. However, it would work using exceptions: try:
doc = vp.execute_throw("....", doc)
except Exception:
pass # handle error here |
Can |
Info message would continue to go to |
A more complete workaround is: import contextlib
import io
import vpype_cli
try:
output = io.StringIO()
with contextlib.redirect_stdout(output):
vpype_cli.execute("read doesntexist.svg show", global_opt="-vv")
print("Output")
print(output.getvalue())
except Exception as e:
print("Error:")
print(type(e))
print(e) This captures both output and catches errors. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would it be possible to get error messages when using the
execute
command from the vpype cli ?The use case would be something like this :
The text was updated successfully, but these errors were encountered: