mirror of
https://github.com/searxng/searxng.git
synced 2025-07-15 01:09:21 +02:00
[enh] record details exception per engine
add an new API /stats/errors
This commit is contained in:
parent
6b5a578822
commit
1d0c368746
10 changed files with 495 additions and 39 deletions
|
@ -34,8 +34,45 @@ class SearxParameterException(SearxException):
|
|||
|
||||
|
||||
class SearxSettingsException(SearxException):
|
||||
"""Error while loading the settings"""
|
||||
|
||||
def __init__(self, message, filename):
|
||||
super().__init__(message)
|
||||
self.message = message
|
||||
self.filename = filename
|
||||
|
||||
|
||||
class SearxEngineException(SearxException):
|
||||
"""Error inside an engine"""
|
||||
|
||||
|
||||
class SearxXPathSyntaxException(SearxEngineException):
|
||||
"""Syntax error in a XPATH"""
|
||||
|
||||
def __init__(self, xpath_spec, message):
|
||||
super().__init__(str(xpath_spec) + " " + message)
|
||||
self.message = message
|
||||
# str(xpath_spec) to deal with str and XPath instance
|
||||
self.xpath_str = str(xpath_spec)
|
||||
|
||||
|
||||
class SearxEngineResponseException(SearxEngineException):
|
||||
"""Impossible to parse the result of an engine"""
|
||||
|
||||
|
||||
class SearxEngineAPIException(SearxEngineResponseException):
|
||||
"""The website has returned an application error"""
|
||||
|
||||
|
||||
class SearxEngineCaptchaException(SearxEngineResponseException):
|
||||
"""The website has returned a CAPTCHA"""
|
||||
|
||||
|
||||
class SearxEngineXPathException(SearxEngineResponseException):
|
||||
"""Error while getting the result of an XPath expression"""
|
||||
|
||||
def __init__(self, xpath_spec, message):
|
||||
super().__init__(str(xpath_spec) + " " + message)
|
||||
self.message = message
|
||||
# str(xpath_spec) to deal with str and XPath instance
|
||||
self.xpath_str = str(xpath_spec)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue