Skip to content

Instantly share code, notes, and snippets.

@enkot
Created August 19, 2018 18:15
Show Gist options
  • Save enkot/bebce5123f318bead5ef4aff6fa67acc to your computer and use it in GitHub Desktop.
Save enkot/bebce5123f318bead5ef4aff6fa67acc to your computer and use it in GitHub Desktop.
@Component
class App extends Vue {
// ...
decodeData(data) {
try {
this.decodedData = atob(data) // can throw DOMException
} catch(error) {
Toast.error(error.message)
}
}
async getData() {
try {
this.data = await api.getData() // can throw Error
} catch(error) {
Toast.error(error.message)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment