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

View File

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