-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow filter overlay errors/warnings with function (#4813)
- Loading branch information
1 parent
ee748a7
commit aab01b3
Showing
14 changed files
with
1,322 additions
and
189 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,24 @@ | ||
"use strict"; | ||
|
||
function unsafeOperation() { | ||
throw new Error("Error message thrown from JS"); | ||
} | ||
/** | ||
* | ||
* @param {string} label | ||
* @param {string} errorMessage | ||
* @returns HTMLButtonElement | ||
*/ | ||
module.exports = function createErrorButton(label, errorMessage) { | ||
function unsafeOperation() { | ||
throw new Error(errorMessage); | ||
} | ||
|
||
function handleButtonClick() { | ||
unsafeOperation(); | ||
} | ||
function handleButtonClick() { | ||
unsafeOperation(); | ||
} | ||
|
||
module.exports = function createErrorButton() { | ||
const errorBtn = document.createElement("button"); | ||
|
||
errorBtn.addEventListener("click", handleButtonClick); | ||
errorBtn.innerHTML = "Click to throw error"; | ||
errorBtn.innerHTML = label; | ||
|
||
return errorBtn; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.