From c9cd741aff6acedaedfd2cf96df06a8b46b4826a Mon Sep 17 00:00:00 2001 From: Rohit Sharma Date: Thu, 14 Jan 2021 01:43:30 +0530 Subject: Throw a `TypeError` instead of the generic `Error` (#32585) * Change from Error to TypeError * Convert the `NAME` to upper case to make the consistency in the error message * Update the remaining tests to be stricter Co-authored-by: XhmikosR --- js/src/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/src/dropdown.js') diff --git a/js/src/dropdown.js b/js/src/dropdown.js index 008294e9b..bada537c9 100644 --- a/js/src/dropdown.js +++ b/js/src/dropdown.js @@ -263,7 +263,7 @@ class Dropdown extends BaseComponent { typeof config.reference.getBoundingClientRect !== 'function' ) { // Popper virtual elements require a getBoundingClientRect method - throw new Error(`${NAME}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`) + throw new TypeError(`${NAME.toUpperCase()}: Option "reference" provided type "object" without a required "getBoundingClientRect" method.`) } return config -- cgit v1.2.3