From 110a8bb594f9a00585e22e01d69eb6bef6b0d9db Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Sun, 3 Mar 2013 16:33:50 +1300 Subject: Print pathod craft explanations to stdout. --- libpathod/language.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'libpathod/language.py') 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): -- cgit v1.2.3