diff options
author | w0rp <devw0rp@gmail.com> | 2018-02-18 10:13:30 +0000 |
---|---|---|
committer | w0rp <devw0rp@gmail.com> | 2018-02-18 10:13:30 +0000 |
commit | 89f8d3e456713846d1ebdd934027ae7a910cf5f8 (patch) | |
tree | 2d06c585ea4ae6c151cfc91a5cfb12a660cac264 /autoload | |
parent | 5915a0ee39ba04a5a4118d5f71766912a6b87fe9 (diff) | |
download | ale-89f8d3e456713846d1ebdd934027ae7a910cf5f8.zip |
Fix #1336 - Print a friendly message when using invalid function names for fixers
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/fix.vim | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/autoload/ale/fix.vim b/autoload/ale/fix.vim index 62a4f9b1..9111db3d 100644 --- a/autoload/ale/fix.vim +++ b/autoload/ale/fix.vim @@ -392,7 +392,13 @@ function! s:GetCallbacks() abort endif endif - call add(l:corrected_list, ale#util#GetFunction(l:Item)) + try + call add(l:corrected_list, ale#util#GetFunction(l:Item)) + catch /E475/ + " Rethrow exceptions for failing to get a function so we can print + " a friendly message about it. + throw 'BADNAME ' . v:exception + endtry endfor return l:corrected_list @@ -427,7 +433,7 @@ function! ale#fix#Fix(...) abort try let l:callback_list = s:GetCallbacks() - catch /E700/ + catch /E700\|BADNAME/ let l:function_name = join(split(split(v:exception, ':')[3])) let l:echo_message = printf( \ 'There is no fixer named `%s`. Check :ALEFixSuggest', |