MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / warn_exception

Function warn_exception

lib/sqlalchemy/util/langhelpers.py:1834–1842  ·  view source on GitHub ↗

executes the given function, catches all exceptions and converts to a warning.

(func: Callable[..., Any], *args: Any, **kwargs: Any)

Source from the content-addressed store, hash-verified

1832
1833
1834def warn_exception(func: Callable[..., Any], *args: Any, **kwargs: Any) -> Any:
1835 """executes the given function, catches all exceptions and converts to
1836 a warning.
1837
1838 """
1839 try:
1840 return func(*args, **kwargs)
1841 except Exception:
1842 warn("%s('%s') ignored" % sys.exc_info()[0:2])
1843
1844
1845def ellipses_string(value, len_=25):

Callers

nothing calls this directly

Calls 1

warnFunction · 0.85

Tested by

no test coverage detected