export default {
  data() {
    return {
      isFetching: true,
    };
  },

  async created() {
    try {
      await this.fetchData();
    } catch (err) {
      this.setError(true);
    } finally {
      this.isFetching = false;
    }
  },
};

import { mapActions } from 'vuex';

export default {
  data() {
    return {
      isFetching: true,
    };
  },

  async created() {
    try {
      await this.fetchData();
    } catch (err) {
      this.setError(true);
    } finally {
      this.isFetching = false;
    }
  },

  methods: {
    ...mapActions('context', ['setError']),
  },
};

fix setError action