Last active
August 20, 2018 19:54
-
-
Save enkot/474920da24009d0c26ba79f00e8a3b2b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
const getDataErrorHandler = (error, ctx) => { | |
ctx.errorMessage = error.message | |
} | |
@Component | |
export default class App extends Vue { | |
errorMessage = '' | |
@Catch(getDataErrorHandler) | |
async getData() { | |
const data = await api.getData() // throws Error | |
return data | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment