aboutsummaryrefslogtreecommitdiffstats
path: root/libpathod/language.py
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2013-03-03 16:33:50 +1300
committerAldo Cortesi <aldo@nullcube.com>2013-03-03 16:33:50 +1300
commit110a8bb594f9a00585e22e01d69eb6bef6b0d9db (patch)
treedad80fdd8c74dd5100d7eefe1640f8e875731d58 /libpathod/language.py
parent155710f9912f0a7370deab2bef6ad0a51ce47f2b (diff)
downloadmitmproxy-110a8bb594f9a00585e22e01d69eb6bef6b0d9db.tar.gz
mitmproxy-110a8bb594f9a00585e22e01d69eb6bef6b0d9db.tar.bz2
mitmproxy-110a8bb594f9a00585e22e01d69eb6bef6b0d9db.zip
Print pathod craft explanations to stdout.
Diffstat (limited to 'libpathod/language.py')
-rw-r--r--libpathod/language.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/libpathod/language.py b/libpathod/language.py
index 6aae7dc7..f3fe4daa 100644
--- a/libpathod/language.py
+++ b/libpathod/language.py
@@ -930,15 +930,18 @@ class Request(_Message):
return ":".join([i.spec() for i in self.tokens])
-def PathodErrorResponse(reason, body=None):
+class PathodErrorResponse(Response):
+ pass
+
+
+def make_error_response(reason, body=None):
tokens = [
Code("800"),
Header(ValueLiteral("Content-Type"), ValueLiteral("text/plain")),
Reason(ValueLiteral(reason)),
Body(ValueLiteral("pathod error: " + (body or reason))),
]
- return Response(tokens)
-
+ return PathodErrorResponse(tokens)
FILESTART = "+"
def read_file(settings, s):