bbuck / dragon-mud

A text-based game engine written in Go and scripted with Lua.
Other
116 stars 16 forks source link

Add an Inspect method to `errors.errorString`. #92

Closed bbuck closed 5 years ago

bbuck commented 6 years ago

When you run require("events") in the REPL you see

=> {
      ["on"] = <function>,
      ["Halt"] = *errors.errorString(intentional halt of event execution),
      ["emit_once"] = <function>,
      ["once"] = <function>,
      ["emit"] = <function>,
    }

The *errors.errorString should have a better representation, perhaps Error("...") or something similar. This may not be something we add directly to this (private) type but more specifically handling an error interface type in the Inspect method for the script engine.