Created
August 19, 2018 18:15
-
-
Save enkot/bebce5123f318bead5ef4aff6fa67acc 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
@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