Skip to content

Commit b9a34c0

Browse files
committed
Add error check
1 parent d848fe7 commit b9a34c0

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

autoload/ddx/custom.vim

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,11 @@ function s:normalize_key_or_dict(key_or_dict, value) abort
6262
let base[a:key_or_dict] = a:value
6363
return base
6464
endif
65-
return {}
66-
endfunction
6765

68-
function s:normalize_string_or_list(string_or_list) abort
69-
if a:string_or_list->type() == v:t_list
70-
return a:string_or_list
71-
elseif a:string_or_list->type() == v:t_string
72-
return [a:string_or_list]
73-
endif
74-
return []
66+
throw printf(
67+
\ 'ddx#custom: "key_or_dict" must be Dict or String, got %s',
68+
\ type(a:key_or_dict)
69+
\ )
7570
endfunction
7671

7772
function s:notify(method, args) abort

0 commit comments

Comments
 (0)