Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Catch(target, key, descriptor) {
- const originalMethod = descriptor.value
- descriptor.value = async function(...args) {
- try {
- return await originalMethod.apply(this, args)
- } catch (error) {
- console.warn(error.message)
- }
- }
- return descriptor
- }
- export default Catch
Add Comment
Please, Sign In to add comment