PageRenderTime 65ms CodeModel.GetById 61ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/jsonrpc/public/services/jsonrpc/errors.py

http://pyjamas.googlecode.com/
Python | 45 lines | 18 code | 8 blank | 19 comment | 0 complexity | 5c66181481b2e62cc13a6b271bfabd8a MD5 | raw file
 1"""
 2  Copyright (c) 2006 Jan-Klaas Kollhof
 3
 4  This file is part of jsonrpc.
 5
 6  jsonrpc is free software; you can redistribute it and/or modify
 7  it under the terms of the GNU Lesser General Public License as published by
 8  the Free Software Foundation; either version 2.1 of the License, or
 9  (at your option) any later version.
10
11  This software is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  GNU Lesser General Public License for more details.
15
16  You should have received a copy of the GNU Lesser General Public License
17  along with this software; if not, write to the Free Software
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
19"""
20
21class JSONRPCError:
22    pass
23
24class DecodingJSONFailed(JSONRPCError):
25    pass
26
27class InvalidJSONMessage(JSONRPCError):
28    pass
29
30class MethodNotFound(JSONRPCError):
31    pass
32
33class InvalidMethodParameters(JSONRPCError):
34    pass
35class MethodNameNotAllowed(JSONRPCError):
36    pass
37    
38    
39
40def getTracebackStr():
41    import traceback
42    import StringIO
43    s=StringIO.StringIO("")
44    traceback.print_exc(file=s)
45    return s.getvalue()