text: /*
      artifact generator: C:\My\wizzi\v5\node_modules\wizzi-js\lib\artifacts\js\module\gen\main.js
      primary source IttfDocument: c:\my\wizzi\v5\plugins\wizzi-codegen\src\ittf\tests\mocks\util\errors.js.ittf
  */
  'use strict';
  var util = require('util');
  
  var md = module.exports = {};
  
  function FileError(message, ex) {
      this.name = 'FileError';
      this.message = message;
      this.inner = ex;
      this.stack = (new Error()).stack;
  }
  FileError.prototype.toString = function() {
      return this.message;
  };
  FileError.prototype = Object.create(Error.prototype);
  FileError.prototype.constructor = FileError;
  md.FileError = FileError;
  
  function NodeError(message, node) {
      this.name = 'NodeError';
      var msg = [
          message
      ];
      if (node) {
          if (node.wzSourceLineInfo) {
              var info = node.wzSourceLineInfo;
              var filePath = 'TODO';
              if (node.wzSourceFilepath) {
                  filePath = node.wzSourceFilepath(info.sourceKey);
              }
              msg.push((' at row: ' + info.row));
              msg.push((', col: ' + info.col));
              msg.push((', source: ' + info.sourceKey));
              msg.push((', in file: ' + filePath));
          }
          else if (node.row) {
              msg.push((' at row: ' + node.row));
              msg.push((', col: ' + node.col));
          }
      }
      this.message = msg.join('');
      // log 'NodeError', this.message
      // set this.node = node
      this.stack = (new Error()).stack;
  }
  NodeError.prototype.toString = function() {
      return this.message;
  };
  NodeError.prototype = Object.create(Error.prototype);
  NodeError.prototype.constructor = NodeError;
  md.NodeError = NodeError;
  
  