Do not throw away python stack trace

Errors when loading powerline fails are almost never giving any useful
information for debugging.
This commit is contained in:
ZyX 2013-02-27 00:20:48 +04:00 committed by Kim Silkebækken
parent a8ccfd4350
commit c2cf679c6f
1 changed files with 10 additions and 7 deletions

View File

@ -10,7 +10,7 @@ function! s:CriticalError(message)
endfunction
if ! has('python') && ! has('python3')
call s:CriticalError('You need vim compiled with Python 2.7 or 3.3+ support
call s:CriticalError('You need vim compiled with Python 2.7 or 3.2+ support
\ for Powerline to work. Please consult the documentation for more details.')
finish
endif
@ -28,12 +28,15 @@ catch
exec s:powerline_pycmd 'sys.path.append(vim.eval(''expand("<sfile>:h:h:h:h:h")''))'
try
exec s:powerline_pycmd s:import_cmd
catch
call s:CriticalError('An error occured while importing the Powerline package.
\ This could be caused by an invalid sys.path setting, or by an incompatible
\ Python version (Powerline requires Python 2.7 or 3.3+ to work). Please consult
\ the troubleshooting section in the documentation for possible solutions.')
finish
let s:launched = 1
finally
if !exists('s:launched')
call s:CriticalError('An error occured while importing the Powerline package.
\ This could be caused by an invalid sys.path setting, or by an incompatible
\ Python version (Powerline requires Python 2.7 or 3.2+ to work). Please consult
\ the troubleshooting section in the documentation for possible solutions.')
finish
endif
endtry
endtry
exec s:powerline_pycmd 'powerline = VimPowerline()'