code: function register(sym, val) {
    messages.set(sym, typeof val === 'function' ? val : String(val));
  }
docs: Register an error code and message.
  @param {string} sym Unique name for the error
  @param {*} val Value of the error