Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Feature Request - Error pop up when launching misconfigured repl #63

Open
theGhostJW opened this issue Feb 21, 2018 · 4 comments
Open

Comments

@theGhostJW
Copy link

  1. Set up REPL pointing to a ghci wrapper exe in settings and open REPL
    => works
  2. rename ghci wrapper exe so configuration is now invalid
  3. open REPL
    => REPL just fails (data entry / live reload panel just vanishes leaving an empty main panel)

Would be good to have an atom error notification with a message like: GHCI wrapper path invalid. Please update ide-haskell-repl settings to correct this.

@lierdakil
Copy link
Contributor

Well, it should show an error pop-up if running an executable fails. And I can't really debug on Windows... For anyone interested, it's handled here:

try {
this.process = CP.spawn(cmd, args, opts)
this.process.stdout.setMaxListeners(100)
this.process.stderr.setMaxListeners(100)
this.process.stdout.setEncoding('utf-8')
this.process.stderr.setEncoding('utf-8')
this.running = true
this.process.on('exit', (code) => {
this.running = false
onDidExit(code)
this.destroy()
})
} catch (error) {
atom.notifications.addFatalError('Error spawning REPL', {
dismissable: true,
// tslint:disable-next-line:no-unsafe-any
stack: error.stack,
detail: `Tried to run "${cmd}" with arguments: ${args}`,
})
this.destroy()
}

My best guess, on Windows it doesn't throw but instead ends with (hopefully) nonzero exit code? But I have no idea, honestly.

@theGhostJW
Copy link
Author

Your guess is correct there is no exception on windows so the catch block does not emit the error.
Exit code is 1 but if I correct the mis-config and run REPL normally then exit REPL the exit code is also 1.

@lierdakil
Copy link
Contributor

So here's an idea: if, say, repl exits in less than a second after being started, something probably went wrong there, so might as well show a message explaining this?

@theGhostJW
Copy link
Author

I think that is a pretty good idea, probably as good as it can be given the absence of an exception on winDoz

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants