Updated 4. Tips & Tricks for working with Jython (markdown)

jomo
2015-08-12 23:57:44 +02:00
parent c130553732
commit 1eac0e8699

@@ -26,6 +26,13 @@ If you want to catch all exceptions (e.g. for debugging), **do not `except Excep
Since we're using jython, this will not catch Java exceptions. Since we're using jython, this will not catch Java exceptions.
Instead, use `except` and print the traceback. This will give you some more deatails: Instead, use `except` and print the traceback. This will give you some more deatails:
```python ```python
# bad
try:
#code
except Exception, e: # will not catch Java Exceptions
print(e)
# good
from traceback import format_exc as trace from traceback import format_exc as trace
try: try:
#code #code