( self )
| 289 | |
| 290 | |
| 291 | def NotifyUserIfServerCrashed( self ): |
| 292 | if ( not self._server_popen or self._user_notified_about_crash or |
| 293 | self.IsServerAlive() ): |
| 294 | return |
| 295 | self._user_notified_about_crash = True |
| 296 | |
| 297 | return_code = self._server_popen.poll() |
| 298 | logfile = os.path.basename( self._server_stderr ) |
| 299 | # See https://github.com/Valloric/ycmd#exit-codes for the list of exit |
| 300 | # codes. |
| 301 | if return_code == 3: |
| 302 | error_message = CORE_UNEXPECTED_MESSAGE.format( logfile = logfile ) |
| 303 | elif return_code == 4: |
| 304 | error_message = CORE_MISSING_MESSAGE |
| 305 | elif return_code == 7: |
| 306 | error_message = CORE_OUTDATED_MESSAGE |
| 307 | elif return_code == 8: |
| 308 | # TODO: here we could retry but discard g:ycm_server_python_interpreter |
| 309 | error_message = PYTHON_TOO_OLD_MESSAGE |
| 310 | else: |
| 311 | error_message = EXIT_CODE_UNEXPECTED_MESSAGE.format( code = return_code, |
| 312 | logfile = logfile ) |
| 313 | |
| 314 | if return_code != 8: |
| 315 | error_message = SERVER_SHUTDOWN_MESSAGE + ' ' + error_message |
| 316 | self._logger.error( error_message ) |
| 317 | vimsupport.PostVimMessage( error_message ) |
| 318 | |
| 319 | |
| 320 | def ServerPid( self ): |
no test coverage detected