Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function generateSomeError(){
- throw Error("YOLO")
- }
- function exceptionWrapper(func){
- return function(){
- try{
- func()
- console.log("OK")
- } catch (e) {
- console.log("Error")
- }
- }
- }
- exceptionWrapper(generateSomeError)()
Add Comment
Please, Sign In to add comment