JsonException.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #region Header
  2. /**
  3. * JsonException.cs
  4. * Base class throwed by LitJSON when a parsing error occurs.
  5. *
  6. * The authors disclaim copyright to this source code. For more details, see
  7. * the COPYING file included with this distribution.
  8. **/
  9. #endregion
  10. using System;
  11. namespace BestHTTP.JSON.LitJson
  12. {
  13. public class JsonException : Exception
  14. {
  15. public JsonException () : base ()
  16. {
  17. }
  18. internal JsonException (ParserToken token) :
  19. base (String.Format (
  20. "Invalid token '{0}' in input string", token))
  21. {
  22. }
  23. internal JsonException (ParserToken token,
  24. Exception inner_exception) :
  25. base (String.Format (
  26. "Invalid token '{0}' in input string", token),
  27. inner_exception)
  28. {
  29. }
  30. internal JsonException (int c) :
  31. base (String.Format (
  32. "Invalid character '{0}' in input string", (char) c))
  33. {
  34. }
  35. internal JsonException (int c, Exception inner_exception) :
  36. base (String.Format (
  37. "Invalid character '{0}' in input string", (char) c),
  38. inner_exception)
  39. {
  40. }
  41. public JsonException (string message) : base (message)
  42. {
  43. }
  44. public JsonException (string message, Exception inner_exception) :
  45. base (message, inner_exception)
  46. {
  47. }
  48. }
  49. }