AQIT 0.1.0
Loading...
Searching...
No Matches
aquin.user_errors Namespace Reference

Functions

bool debug_enabled ()
None log_debug (str label, Any detail)
str _scrub_urls (str text)
str sanitize_error_string (str text)
str friendly_message (BaseException exc)
None die (str|None message=None, *, BaseException|None exc=None, int code=1, str label="aquin")
None exit_on (BaseException exc, *, str label="aquin", int code=1)

Variables

 _URL_RE = re.compile(r"https?://[^\s'\"<>]+")

Function Documentation

◆ _scrub_urls()

str _scrub_urls ( str text)
protected

Definition at line 27 of file user_errors.py.

Referenced by sanitize_error_string().

◆ debug_enabled()

bool debug_enabled ( )

Definition at line 18 of file user_errors.py.

Referenced by friendly_message(), log_debug(), and sanitize_error_string().

◆ die()

None die ( str | None message = None,
* ,
BaseException | None exc = None,
int code = 1,
str label = "aquin" )

Definition at line 169 of file user_errors.py.

References friendly_message(), and log_debug().

Referenced by exit_on().

◆ exit_on()

None exit_on ( BaseException exc,
* ,
str label = "aquin",
int code = 1 )

Definition at line 185 of file user_errors.py.

References die().

◆ friendly_message()

str friendly_message ( BaseException exc)

Definition at line 90 of file user_errors.py.

References debug_enabled(), and sanitize_error_string().

Referenced by die().

◆ log_debug()

None log_debug ( str label,
Any detail )

Definition at line 22 of file user_errors.py.

References debug_enabled().

Referenced by die().

◆ sanitize_error_string()

str sanitize_error_string ( str text)
Turn raw API/library strings into short user-facing messages.

Definition at line 31 of file user_errors.py.

References _scrub_urls(), debug_enabled(), and sanitize_error_string().

Referenced by friendly_message(), and sanitize_error_string().

Variable Documentation

◆ _URL_RE

aquin.user_errors._URL_RE = re.compile(r"https?://[^\s'\"<>]+")
protected

Definition at line 15 of file user_errors.py.