Fix incorrect error handling in some api calls
This commit is contained in:
@@ -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()
|
||||
})
|
||||
|
||||
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user