kadena-io / pact-5

The New Pact
BSD 3-Clause "New" or "Revised" License
8 stars 7 forks source link

Running a REPL file from the command line doesn't show errors #261

Open CryptoPascal31 opened 3 weeks ago

CryptoPascal31 commented 3 weeks ago

Issue description

When starting a REPL file from the command line, Pact 5.0 doesn't show errors. It only shows Load failed

Steps to reproduce

Let's consider the file broken-script.repl. It contains:

; This is a bad function call
(this-function-does-not-exist)

If I load it inside the repl:

$ pact-5
pact>(load "broken-script.repl")
"Loading broken-script.repl..."
broken-script.repl:2:1: Cannot find module:  this-function-does-not-exist
 2 | (this-function-does-not-exist)
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

pact>

Good ... Pact gives me useful information.

But if I invoke it directly from the command line arguments:

$ pact-5 broken-script.repl
Load failed
$

I have got no information about what's wrong... only Load failed

Expected Behavior

I would expect to have the same level of debug and error reporting when invoking the script from the command line. It's important, since I have some tests suites split in several repl files, batch called by a shell/make script, or GH actions.

From my point of view, it's critical to be able to identify quickly errors when running the test suite.