JsonException.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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 LitJson
  12. {
  13. public class JsonException :
  14. #if NETSTANDARD1_5
  15. Exception
  16. #else
  17. ApplicationException
  18. #endif
  19. {
  20. public JsonException () : base ()
  21. {
  22. }
  23. internal JsonException (ParserToken token) :
  24. base (String.Format (
  25. "Invalid token '{0}' in input string", token))
  26. {
  27. }
  28. internal JsonException (ParserToken token,
  29. Exception inner_exception) :
  30. base (String.Format (
  31. "Invalid token '{0}' in input string", token),
  32. inner_exception)
  33. {
  34. }
  35. internal JsonException (int c) :
  36. base (String.Format (
  37. "Invalid character '{0}' in input string", (char) c))
  38. {
  39. }
  40. internal JsonException (int c, Exception inner_exception) :
  41. base (String.Format (
  42. "Invalid character '{0}' in input string", (char) c),
  43. inner_exception)
  44. {
  45. }
  46. public JsonException (string message) : base (message)
  47. {
  48. }
  49. public JsonException (string message, Exception inner_exception) :
  50. base (message, inner_exception)
  51. {
  52. }
  53. }
  54. }