Coverage for pyquickhelper/loghelper/pqh_exception.py: 100%
7 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-03 02:21 +0200
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-03 02:21 +0200
1# -*- coding: utf-8 -*-
2"""
3@file
4@brief logged exception
6By default, all exceptions are logged through the function fLOG (@see fn fLOG).
8::
10 raise PQHException ("message")
11"""
14class PQHException (Exception):
16 """
17 Define an exception.
19 - exception used in Python module to make exception
20 raised by this module easier to catch
21 - every time exception is logged
22 """
24 def __init__(self, m, log=True):
25 """constructor
26 @param m message
27 @param log log the exception
28 """
29 Exception.__init__(self, m)
30 if log:
31 from .flog import fLOG
32 fLOG("PQHException", m)