Skip to content
This repository has been archived by the owner on Nov 29, 2020. It is now read-only.

Commit

Permalink
check ycmd exit code
Browse files Browse the repository at this point in the history
  • Loading branch information
Qusic committed May 16, 2016
1 parent 5e66adf commit 38d5bdf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/handler.coffee
Expand Up @@ -66,10 +66,17 @@ launch = ->
'--idle_suicide_seconds=600'
]
options: {}
exit: (status) -> ycmdProcess = null
setTimeout(fulfill, 1000)
stdout: (output) -> utility.debugLog 'CONSOLE', output
stderr: (output) -> utility.debugLog 'CONSOLE', output
exit: (code) ->
ycmdProcess = null
switch code
when 3 then reject new Error 'Unexpected error while loading the YCM core library.'
when 4 then reject new Error 'YCM core library not detected; you need to compile YCM before using it. Follow the instructions in the documentation.'
when 5 then reject new Error 'YCM core library compiled for Python 3 but loaded in Python 2. Set the Python Executable config to a Python 3 interpreter path.'
when 6 then reject new Error 'YCM core library compiled for Python 2 but loaded in Python 3. Set the Python Executable config to a Python 2 interpreter path.'
when 7 then reject new Error 'YCM core library too old; PLEASE RECOMPILE by running the install.py script. See the documentation for more details.'
setTimeout fulfill, 1000

Promise.all [findUnusedPort, generateRandomSecret, readDefaultOptions]
.then processData
Expand Down

0 comments on commit 38d5bdf

Please sign in to comment.