Skip to content

Instantly share code, notes, and snippets.

@enkot
Last active August 20, 2018 08:52
Show Gist options
  • Select an option

  • Save enkot/e9e70955711120207b7371859b73c861 to your computer and use it in GitHub Desktop.

Select an option

Save enkot/e9e70955711120207b7371859b73c861 to your computer and use it in GitHub Desktop.
// register global handler
catchDecorator.register((error) => Toast.error(error.message))
@Component
class LoginPage extends Vue {
// ...
// catch errors and run global handler
@Catch()
async loginUser() {
const token = await api.loginUser(this.email, this.password)
handleLogin(token)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment