Vue.js: Nuxt error handling
The reason why option #4 is not working is because you’re returning a function that never gets executed: function catchPlugin(outerFunction) { return function async innerFunction(args) { try { const data = await outerFunction(args); return { data } } catch (error) { return { error } } } } Usage: const execute = catchPlugin((args) => { … Read more