Skip to content

Instantly share code, notes, and snippets.

@enkot
Last active August 20, 2018 15:00
Show Gist options
  • Save enkot/2e8eb26c3d3fb617e4d5f6560e85860f to your computer and use it in GitHub Desktop.
Save enkot/2e8eb26c3d3fb617e4d5f6560e85860f to your computer and use it in GitHub Desktop.
import Catch, { catchDecoratorStore } from './catchDecorator'
catchDecoratorStore.setHandler(error => Toast.error(error.message))
@Component
export default class App extends Vue {
@Catch
async created() {
const data = await api.getData() // throws Error
// ...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment