/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. This file is part of jsonrpc.
  4. jsonrpc is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU Lesser General Public License as published by
  6. the Free Software Foundation; either version 2.1 of the License, or
  7. (at your option) any later version.
  8. This software is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public License
  13. along with this software; if not, write to the Free Software
  14. Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  15. """
  16. class JSONRPCError:
  17. pass
  18. class DecodingJSONFailed(JSONRPCError):
  19. pass
  20. class InvalidJSONMessage(JSONRPCError):
  21. pass
  22. class MethodNotFound(JSONRPCError):
  23. pass
  24. class InvalidMethodParameters(JSONRPCError):
  25. pass
  26. class MethodNameNotAllowed(JSONRPCError):
  27. pass
  28. def getTracebackStr():
  29. import traceback
  30. import StringIO
  31. s=StringIO.StringIO("")
  32. traceback.print_exc(file=s)
  33. return s.getvalue()