zwild / ob-ammonite

org-babel for scala evaluation in Ammonite
GNU General Public License v3.0
14 stars 2 forks source link

Fail fast on errors #5

Open kschwarz1116 opened 4 years ago

kschwarz1116 commented 4 years ago

I'm currently trying to execute the following block of code in an org buffer:

import $ivy.`com.chuusai::shapeless:2.3.3`_
import shapeless._

case class Employee(name: String, number: Int, manager: Boolean)

case class IceCream(name: String, numCherries: Int, inCone: Boolean)

There's an error due to the underscore from the first line. However, the result I get is unrelated to that:

: (console):1:11 expected end-of-input
:  }
:           ^
:

When I open up the *Ammonite* buffer, it looks like execution continues even after the failure on the first line:

me-org@ {
                   import $ivy.`com.chuusai::shapeless:2.3.3`_
(console):2:44 expected (Semis | &"}" | end-of-input)
 import $ivy.`com.chuusai::shapeless:2.3.3`_
                                           ^

me-org@ import shapeless._
import shapeless._

me-org@

me-org@ case class Employee(name: String, number: Int, manager: Boolean)
defined class Employee

me-org@

me-org@ case class IceCream(name: String, numCherries: Int, inCone: Boolean)
defined class IceCream

me-org@ ;;;;;;;;; }
(console):1:11 expected end-of-input
;;;;;;;;; }
          ^

It would be nice if the error from the first line got sent back to org instead of the error from the last line.

kschwarz1116 commented 4 years ago

I'll try digging into this on Monday!