diff options
Diffstat (limited to 'core/search/js/search.js')
-rw-r--r-- | core/search/js/search.js | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/search/js/search.js b/core/search/js/search.js index 461c963c471..167d7c7a53d 100644 --- a/core/search/js/search.js +++ b/core/search/js/search.js @@ -52,10 +52,13 @@ var self = this; if (typeof searchCallback !== 'function') { - throw 'searchCallback must be a function'; + throw new Error('searchCallback must be a function'); } if (typeof resetCallback !== 'function') { - throw 'resetCallback must be a function'; + throw new Error('resetCallback must be a function'); + } + if (!document.getElementById('searchbox')) { + throw new Error('searchBox not available'); } this.searchCallback = searchCallback; |