JAVASCRIPT   85

Exception js

Guest on 31st May 2022 01:56:34 AM

  1. /**
  2.  * @author Tom
  3.  */
  4.  
  5. function Exception(message, data, inner) {
  6.         this.message = message;
  7.         this.data = data;
  8.         this.inner = inner;
  9. }
  10.  
  11. Exception.prototype.toString = function() {
  12.         var text = this.message;
  13.         if (this.data) {
  14.                 text += " " + Json.write(this.data);
  15.         }
  16.         if (this.inner) {
  17.                 text += " < " + this.inner;
  18.         }
  19.         return text;
  20. };

Raw Paste


Login or Register to edit or fork this paste. It's free.