MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / add_break_on_exception

Method add_break_on_exception

pydevd.py:1884–1928  ·  view source on GitHub ↗
(
        self,
        exception,
        condition,
        expression,
        notify_on_handled_exceptions,
        notify_on_unhandled_exceptions,
        notify_on_user_unhandled_exceptions,
        notify_on_first_raise_only,
        ignore_libraries=False,
    )

Source from the content-addressed store, hash-verified

1882 self._clear_caches()
1883
1884 def add_break_on_exception(
1885 self,
1886 exception,
1887 condition,
1888 expression,
1889 notify_on_handled_exceptions,
1890 notify_on_unhandled_exceptions,
1891 notify_on_user_unhandled_exceptions,
1892 notify_on_first_raise_only,
1893 ignore_libraries=False,
1894 ):
1895 try:
1896 eb = ExceptionBreakpoint(
1897 exception,
1898 condition,
1899 expression,
1900 notify_on_handled_exceptions,
1901 notify_on_unhandled_exceptions,
1902 notify_on_user_unhandled_exceptions,
1903 notify_on_first_raise_only,
1904 ignore_libraries,
1905 )
1906 except ImportError:
1907 pydev_log.critical("Error unable to add break on exception for: %s (exception could not be imported).", exception)
1908 return None
1909
1910 if eb.notify_on_unhandled_exceptions:
1911 cp = self.break_on_uncaught_exceptions.copy()
1912 cp[exception] = eb
1913 pydev_log.info("Exceptions to hook on terminate: %s.", cp)
1914 self.break_on_uncaught_exceptions = cp
1915
1916 if eb.notify_on_handled_exceptions:
1917 cp = self.break_on_caught_exceptions.copy()
1918 cp[exception] = eb
1919 pydev_log.info("Exceptions to hook always: %s.", cp)
1920 self.break_on_caught_exceptions = cp
1921
1922 if eb.notify_on_user_unhandled_exceptions:
1923 cp = self.break_on_user_uncaught_exceptions.copy()
1924 cp[exception] = eb
1925 pydev_log.info("Exceptions to hook on user uncaught code: %s.", cp)
1926 self.break_on_user_uncaught_exceptions = cp
1927
1928 return eb
1929
1930 def set_suspend(
1931 self,

Callers 3

cmd_set_py_exceptionMethod · 0.80

Calls 3

ExceptionBreakpointClass · 0.90
copyMethod · 0.80
infoMethod · 0.80

Tested by

no test coverage detected