Guest User

Untitled

a guest
Aug 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function Catch(target, key, descriptor) {
  2. const originalMethod = descriptor.value
  3.  
  4. descriptor.value = async function(...args) {
  5. try {
  6. return await originalMethod.apply(this, args)
  7. } catch (error) {
  8. console.warn(error.message)
  9. }
  10. }
  11.  
  12. return descriptor
  13. }
  14.  
  15. export default Catch
Add Comment
Please, Sign In to add comment