From ea14db28b8bb2b25d651d4f462dadf900c7b5a04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Mon, 24 Oct 2022 20:31:51 +0200 Subject: [PATCH] Fix incorrect error handling in some api calls --- .../ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue | 4 ++-- .../ep_theme/Resources/Private/Assets/js/myep/api/index.js | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue index ec52600c..f63ca9fa 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/BookingEdit.vue @@ -171,7 +171,7 @@ import ServicesOverview from './components/ServicesOverview' import TransportationSelect from './components/TransportationSelect' import { mapGetters, mapMutations, mapState } from 'vuex' - import { checkStatus, defaultOptions } from './api' + import {checkStatus, defaultOptions, handleError} from './api' export default { name: 'BookingEdit', @@ -232,7 +232,7 @@ this.participantData = data.participantData this.travelData = data.travelData }) - .catch(() => {}) + .catch(handleError) .finally(() => { this.endLoading() }) diff --git a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/api/index.js b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/api/index.js index 1771ad2a..e36ce7a6 100644 --- a/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/api/index.js +++ b/public/typo3conf/ext/ep_theme/Resources/Private/Assets/js/myep/api/index.js @@ -9,7 +9,7 @@ function checkStatus(response) { if (response.ok) { return response } else { - const error = new Error(response.status) + const error = new Error(response.statusText) error.response = response.json() throw error } @@ -20,7 +20,6 @@ function handleError() { message: 'Es ist ein Fehler aufgetreten :(', success: false, }) - throw error } export { checkStatus, handleError, defaultOptions }