Giter VIP home page Giter VIP logo

Comments (5)

dillonkearns avatar dillonkearns commented on June 5, 2024

Great point! That should definitely give a non-zero exit status and print the error message.

from elm-pages.

dillonkearns avatar dillonkearns commented on June 5, 2024

I'm not able to reproduce it on master:

module Todo exposing (run)

import BackendTask
import Pages.Script as Script exposing (Script)


run : Script
run =
    Script.withoutCliOptions
        (BackendTask.succeed ()
            |> BackendTask.andThen
                (\_ ->
                    Debug.todo "!!!TODO!!!!"
                )
        )

from elm-pages.

dillonkearns avatar dillonkearns commented on June 5, 2024
npx elm-pages run script/src/Todo.elm
Trace: Error: TODO in module `Todo` on line 13

!!!TODO!!!!
    at _Debug_crash (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:498:10)
    at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:254:3
    at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9176:7
    at Function.f (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9085:13)
    at A2 (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:56:28)
    at /Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9168:2
    at Object.<anonymous> (/Users/dillonkearns/src/github.com/dillonkearns/elm-pages/examples/end-to-end/script/elm-stuff/elm-pages/elm.cjs:9306:5)
    at Module._compile (node:internal/modules/cjs/loader:1275:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
    at Module.load (node:internal/modules/cjs/loader:1133:32)
    at Command.<anonymous> (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/cli.js:168:17)
Trace: Unexpected error format Unexpected error {}
    at restoreColor (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/error-formatter.js:104:13)
    at restoreColorSafe (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/error-formatter.js:121:14)
    at Command.<anonymous> (file:///Users/dillonkearns/src/github.com/dillonkearns/elm-pages/generator/src/cli.js:169:21)
Error: TODO in module `Todo` on line 13

!!!TODO!!!!

from elm-pages.

dillonkearns avatar dillonkearns commented on June 5, 2024

Exits with code 1.

from elm-pages.

miniBill avatar miniBill commented on June 5, 2024

Got it!

module Repro exposing (run)

import BackendTask
import Pages.Script as Script exposing (Script)


run : Script
run =
    Script.log "Just"
        |> BackendTask.andThen (\_ -> Debug.todo "break")
        |> Script.withoutCliOptions

It's very subtle! succeed () instead of Script.log will give the correct error

from elm-pages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.