Skip to content

Commit

Permalink
IceCreamDebugger ignores exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
NightMachinery committed Aug 4, 2023
1 parent fc40981 commit 4c7fab3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions icecream/icecream.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
from contextlib import contextmanager
from os.path import basename, realpath
from textwrap import dedent
import traceback

import colorama
import executing
Expand Down Expand Up @@ -208,8 +209,11 @@ def __init__(self, prefix=DEFAULT_PREFIX,

def __call__(self, *args):
if self.enabled:
callFrame = inspect.currentframe().f_back
self.outputFunction(self._format(callFrame, *args))
try:
callFrame = inspect.currentframe().f_back
self.outputFunction(self._format(callFrame, *args))
except:
print(f"IceCreamDebugger: exception ignored:\n\n {traceback.format_exc()}", sys.stderr)

if not args: # E.g. ic().
passthrough = None
Expand Down

0 comments on commit 4c7fab3

Please sign in to comment.