/src/org/json/JSONException.java

http://github.com/nddrylliog/ooc · Java · 33 lines · 16 code · 5 blank · 12 comment · 0 complexity · 76a8bac31388d3572dcfd61928fc5e7e MD5 · raw file

  1. package org.json;
  2. /**
  3. * The JSONException is thrown by the JSON.org classes when things are amiss.
  4. * @author JSON.org
  5. * @version 2008-09-18
  6. */
  7. public class JSONException extends Exception {
  8. /**
  9. *
  10. */
  11. private static final long serialVersionUID = 5894276831604379907L;
  12. private Throwable cause;
  13. /**
  14. * Constructs a JSONException with an explanatory message.
  15. * @param message Detail about the reason for the exception.
  16. */
  17. public JSONException(String message) {
  18. super(message);
  19. }
  20. public JSONException(Throwable t) {
  21. super(t.getMessage());
  22. this.cause = t;
  23. }
  24. @Override
  25. public Throwable getCause() {
  26. return this.cause;
  27. }
  28. }