semanticError.js 328 B

12345678910111213141516
  1. export class SemanticError extends Error {
  2. constructor (msg, id) {
  3. super(msg);
  4. this.id = id;
  5. this._context = {};
  6. if (Error.captureStackTrace) Error.captureStackTrace(this, SemanticError);
  7. }
  8. get context () {
  9. return this._context;
  10. }
  11. set context (contextObj) {
  12. this._context = contextObj;
  13. }
  14. }