From 1eac0e8699b2058ba8d0e52c54072103d146dcc8 Mon Sep 17 00:00:00 2001 From: jomo Date: Wed, 12 Aug 2015 23:57:44 +0200 Subject: [PATCH] Updated 4. Tips & Tricks for working with Jython (markdown) --- ...ython.md => 4.-Tips-&-Tricks-for-working-with-Jython.md | 7 +++++++ 1 file changed, 7 insertions(+) rename 4. Tips & Tricks for working with Jython.md => 4.-Tips-&-Tricks-for-working-with-Jython.md (94%) diff --git a/4. Tips & Tricks for working with Jython.md b/4.-Tips-&-Tricks-for-working-with-Jython.md similarity index 94% rename from 4. Tips & Tricks for working with Jython.md rename to 4.-Tips-&-Tricks-for-working-with-Jython.md index 646b373..c3e0073 100644 --- a/4. Tips & Tricks for working with Jython.md +++ b/4.-Tips-&-Tricks-for-working-with-Jython.md @@ -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. Instead, use `except` and print the traceback. This will give you some more deatails: ```python +# bad +try: + #code +except Exception, e: # will not catch Java Exceptions + print(e) + +# good from traceback import format_exc as trace try: #code