Skip to content

Instantly share code, notes, and snippets.

@enkot
Last active August 20, 2018 19:54
Show Gist options
  • Save enkot/474920da24009d0c26ba79f00e8a3b2b to your computer and use it in GitHub Desktop.
Save enkot/474920da24009d0c26ba79f00e8a3b2b to your computer and use it in GitHub Desktop.
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