(sentry) do not capture errors from $post, instead send them up the promise chain

This commit is contained in:
Valentyne Stigloher 2024-03-09 15:30:02 +01:00
parent 4e7dc34634
commit f0ece7bbae

View File

@ -35,7 +35,6 @@
<script>
import Vue from 'vue';
import * as Sentry from '@sentry/vue';
import dark from '../plugins/dark.js';
import sorter from 'avris-sorter';
import { sleep } from '../src/helpers.ts';
@ -100,9 +99,8 @@ export default {
this.$axios.$post(url, data, { ...options, timeout })
.then((data) => resolve(data))
.catch(async (error) => {
Sentry.captureException(error);
await this.$alert(this.$t(error.response?.data?.error || 'error.generic'), 'danger');
reject();
reject(new Error(`POST to ${url} failed: ${error.response?.data?.error || 'unknown error'}`));
});
});
};