-
Notifications
You must be signed in to change notification settings - Fork 4
Fix #6: Throw a structured exception when a command fails to start #7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
@Test | ||
def failingCommand: Unit = { | ||
val run = ExternalJSRun.start(List("false"), ExternalJSRun.Config())(_.close()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be surprised if this works on Windows.
class ExternalJSRunFailureTest { | ||
|
||
def assertFails(future: Future[Unit])( | ||
pf: PartialFunction[Throwable, Unit]) = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either make this private or give it an explicit result type (or both).
|
||
@Test | ||
def abortedCommand: Unit = { | ||
val run = ExternalJSRun.start(List("cat"), ExternalJSRun.Config()) { _ => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would also fail on Windows.
try { | ||
builder.start() | ||
} catch { | ||
case t: Throwable => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably restrict this to NonFatal
exceptions, no?
No description provided.