Confidenceman02 / django-elm

A framework for using Elm programs in Django
MIT License
29 stars 1 forks source link

`compilebuild` command swallows compiler errors #81

Closed kdelwat closed 6 months ago

kdelwat commented 7 months ago

Huge fan of this library but I'm running into a slight issue with the compilebuild command.

If compilation fails (usually due to use of Debug), the error is swallowed and the command exits successfully, but no output files are generated.

I would expect the command to instead exit with an error code.

I think the offending lines are in strategy.py, line 202 onwards:

process = SubProcess(
    ["node", "-e", COMPILE_PROGRAM],
    os.path.join(src_path.value),
    self.raise_error,
)
try:
    process.open()
except Exception as _:
    return ExitSuccess(None)

The except branch should probably return a StrategyError?

Confidenceman02 commented 7 months ago

Howdy there!!

Fantastic find and thanks for raising the issue!

Totally correct, it should raise an error!

I'll get on it.

Confidenceman02 commented 7 months ago

Released in 0.7.0

Update with:

pip install -U djelm