MCPcopy Create free account
hub / github.com/Pylons/webtest / AppError

Class AppError

webtest/app.py:36–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34
35
36class AppError(Exception):
37
38 def __init__(self, message, *args):
39 if isinstance(message, bytes):
40 message = message.decode('utf8')
41 str_args = ()
42 for arg in args:
43 if isinstance(arg, webob.Response):
44 body = arg.body
45 if isinstance(body, bytes):
46 if arg.charset:
47 arg = body.decode(arg.charset)
48 else:
49 arg = repr(body)
50 elif isinstance(arg, bytes):
51 try:
52 arg = arg.decode('utf8')
53 except UnicodeDecodeError:
54 arg = repr(arg)
55 str_args += (arg,)
56 message = message % str_args
57 Exception.__init__(self, message)
58
59
60class CookiePolicy(http_cookiejar.DefaultCookiePolicy):

Callers 3

test_app_errorMethod · 0.90
_check_statusMethod · 0.85
_check_errorsMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_app_errorMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…