feat: don't rethrow same error and handle errors globally

This commit is contained in:
Dominik Pschenitschni 2021-10-09 16:04:19 +02:00
parent 6f51921588
commit 3b940cb56c
No known key found for this signature in database
GPG key ID: B257AC0149F43A77
71 changed files with 69 additions and 451 deletions

View file

@ -109,7 +109,6 @@ export default defineComponent({
this.$message.success({message: this.$t('user.deletion.confirmSuccess')}) this.$message.success({message: this.$t('user.deletion.confirmSuccess')})
this.$store.dispatch('auth/refreshUserInfo') this.$store.dispatch('auth/refreshUserInfo')
}) })
.catch(e => this.$message.error(e))
} }
}, },
}, },

View file

@ -128,9 +128,6 @@ export default {
}, },
loadLabels() { loadLabels() {
this.$store.dispatch('labels/loadAllLabels') this.$store.dispatch('labels/loadAllLabels')
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -218,7 +218,6 @@ export default {
return return
} }
this.$store.dispatch('lists/toggleListFavorite', list) this.$store.dispatch('lists/toggleListFavorite', list)
.catch(e => this.$message.error(e))
}, },
resize() { resize() {
// Hide the menu by default on mobile // Hide the menu by default on mobile
@ -263,9 +262,6 @@ export default {
...list, ...list,
position, position,
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.listUpdating[list.id] = false this.listUpdating[list.id] = false
}) })

View file

@ -483,7 +483,6 @@ export default {
.then(r => { .then(r => {
this[kind] = r this[kind] = r
}) })
.catch(e => this.$message.error(e))
} }
}, },
setDoneFilter() { setDoneFilter() {
@ -535,9 +534,6 @@ export default {
// Filter users from the results who are already assigned // Filter users from the results who are already assigned
this[`found${kind}`] = response.filter(({id}) => !includesById(this[kind], id)) this[`found${kind}`] = response.filter(({id}) => !includesById(this[kind], id))
}) })
.catch(e => {
this.$message.error(e)
})
}, },
add(kind, filterName) { add(kind, filterName) {
this.$nextTick(() => { this.$nextTick(() => {

View file

@ -68,9 +68,6 @@ export default {
.then(b => { .then(b => {
this.background = b this.background = b
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => this.backgroundLoading = false) .finally(() => this.backgroundLoading = false)
}, },
toggleFavoriteList(list) { toggleFavoriteList(list) {
@ -80,7 +77,6 @@ export default {
return return
} }
this.$store.dispatch('lists/toggleListFavorite', list) this.$store.dispatch('lists/toggleListFavorite', list)
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -138,9 +138,6 @@ export default {
} }
this.migrate() this.migrate()
}) })
.catch(e => {
this.$message.error(e)
})
} }
}, },
methods: { methods: {
@ -149,9 +146,6 @@ export default {
.then(r => { .then(r => {
this.authUrl = r.url this.authUrl = r.url
}) })
.catch(e => {
this.$message.error(e)
})
}, },
migrate() { migrate() {
this.isMigrating = true this.isMigrating = true
@ -167,9 +161,6 @@ export default {
this.message = r.message this.message = r.message
this.$store.dispatch('namespaces/loadNamespaces') this.$store.dispatch('namespaces/loadNamespaces')
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.isMigrating = false this.isMigrating = false
}) })
@ -184,9 +175,6 @@ export default {
this.message = r.message this.message = r.message
this.$store.dispatch('namespaces/loadNamespaces') this.$store.dispatch('namespaces/loadNamespaces')
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.isMigrating = false this.isMigrating = false
}) })

View file

@ -99,9 +99,6 @@ export default {
this.$emit('change', subscription) this.$emit('change', subscription)
this.$message.success({message: this.$t('task.subscription.subscribeSuccess', {entity: this.entity})}) this.$message.success({message: this.$t('task.subscription.subscribeSuccess', {entity: this.entity})})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
unsubscribe() { unsubscribe() {
const subscription = new SubscriptionModel({ const subscription = new SubscriptionModel({
@ -113,9 +110,6 @@ export default {
this.$emit('change', null) this.$emit('change', null)
this.$message.success({message: this.$t('task.subscription.unsubscribeSuccess', {entity: this.entity})}) this.$message.success({message: this.$t('task.subscription.unsubscribeSuccess', {entity: this.entity})})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -98,9 +98,6 @@ export default {
.then(r => { .then(r => {
this.allNotifications = r this.allNotifications = r
}) })
.catch(e => {
this.$message.error(e)
})
}, },
to(n, index) { to(n, index) {
const to = { const to = {
@ -137,7 +134,6 @@ export default {
.then(r => { .then(r => {
this.allNotifications[index] = r this.allNotifications[index] = r
}) })
.catch(e => this.$message.error(e))
} }
}, },
}, },

View file

@ -392,9 +392,6 @@ export default {
this.$router.push({name: 'task.detail', params: {id: r.id}}) this.$router.push({name: 'task.detail', params: {id: r.id}})
this.closeQuickActions() this.closeQuickActions()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
newList() { newList() {
if (this.currentList === null) { if (this.currentList === null) {
@ -411,9 +408,6 @@ export default {
this.$router.push({name: 'list.index', params: {listId: r.id}}) this.$router.push({name: 'list.index', params: {listId: r.id}})
this.closeQuickActions() this.closeQuickActions()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
newNamespace() { newNamespace() {
const newNamespace = new NamespaceModel({title: this.query}) const newNamespace = new NamespaceModel({title: this.query})
@ -423,9 +417,6 @@ export default {
this.$message.success({message: this.$t('namespace.create.success')}) this.$message.success({message: this.$t('namespace.create.success')})
this.closeQuickActions() this.closeQuickActions()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
newTeam() { newTeam() {
const newTeam = new TeamModel({name: this.query}) const newTeam = new TeamModel({name: this.query})
@ -438,9 +429,6 @@ export default {
this.$message.success({message: this.$t('team.create.success')}) this.$message.success({message: this.$t('team.create.success')})
this.closeQuickActions() this.closeQuickActions()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
select(parentIndex, index) { select(parentIndex, index) {

View file

@ -226,9 +226,6 @@ export default {
.then((r) => { .then((r) => {
this.linkShares = r this.linkShares = r
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
add(listId) { add(listId) {
const newLinkShare = new LinkShareModel({ const newLinkShare = new LinkShareModel({
@ -247,9 +244,6 @@ export default {
this.$message.success({message: this.$t('list.share.links.createSuccess')}) this.$message.success({message: this.$t('list.share.links.createSuccess')})
this.load(listId) this.load(listId)
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
remove(listId) { remove(listId) {
const linkshare = new LinkShareModel({ const linkshare = new LinkShareModel({
@ -262,9 +256,6 @@ export default {
this.$message.success({message: this.$t('list.share.links.deleteSuccess')}) this.$message.success({message: this.$t('list.share.links.deleteSuccess')})
this.load(listId) this.load(listId)
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.showDeleteModal = false this.showDeleteModal = false
}) })

View file

@ -281,9 +281,6 @@ export default {
this.selectedRight[s.id] = s.right, this.selectedRight[s.id] = s.right,
) )
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
deleteSharable() { deleteSharable() {
if (this.shareType === 'user') { if (this.shareType === 'user') {
@ -306,9 +303,6 @@ export default {
} }
this.$message.success({message: this.$t('list.share.userTeam.removeSuccess', {type: this.shareTypeName, sharable: this.sharableName})}) this.$message.success({message: this.$t('list.share.userTeam.removeSuccess', {type: this.shareTypeName, sharable: this.sharableName})})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
add(admin) { add(admin) {
if (admin === null) { if (admin === null) {
@ -331,9 +325,6 @@ export default {
this.$message.success({message: this.$t('list.share.userTeam.addedSuccess', {type: this.shareTypeName})}) this.$message.success({message: this.$t('list.share.userTeam.addedSuccess', {type: this.shareTypeName})})
this.load() this.load()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
toggleType(sharable) { toggleType(sharable) {
if ( if (
@ -367,9 +358,6 @@ export default {
} }
this.$message.success({message: this.$t('list.share.userTeam.updatedSuccess', {type: this.shareTypeName})}) this.$message.success({message: this.$t('list.share.userTeam.updatedSuccess', {type: this.shareTypeName})})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
find(query) { find(query) {
if (query === '') { if (query === '') {
@ -382,9 +370,6 @@ export default {
.then((response) => { .then((response) => {
this.found = response this.found = response
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
clearAll() { clearAll() {
this.found = [] this.found = []

View file

@ -113,16 +113,16 @@ export default {
) )
}) })
Promise.all(newTasks) return Promise.all(newTasks)
.then(() => { .then(() => {
this.newTaskTitle = '' this.newTaskTitle = ''
}) })
.catch(e => { .catch(e => {
if (e === 'NO_LIST') { if (e.message === 'NO_LIST') {
this.errorMessage = this.$t('list.create.addListRequired') this.errorMessage = this.$t('list.create.addListRequired')
return return
} }
this.$message.error(e) throw e
}) })
}, },
handleEnter(e) { handleEnter(e) {

View file

@ -142,9 +142,6 @@ export default {
this.initTaskFields() this.initTaskFields()
this.$message.success({message: this.$t('task.detail.updateSuccess')}) this.$message.success({message: this.$t('task.detail.updateSuccess')})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -317,9 +317,6 @@ export default {
return tasks return tasks
} }
}) })
.catch((e) => {
return Promise.reject(e)
})
} }
getAllTasks() getAllTasks()
@ -343,9 +340,6 @@ export default {
return 0 return 0
}) })
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
addGantAttributes(t) { addGantAttributes(t) {
if (typeof t.durationDays !== 'undefined' && typeof t.offsetDays !== 'undefined') { if (typeof t.durationDays !== 'undefined' && typeof t.offsetDays !== 'undefined') {
@ -423,9 +417,6 @@ export default {
} }
} }
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
editTask(task) { editTask(task) {
this.taskToEdit = task this.taskToEdit = task
@ -460,9 +451,6 @@ export default {
this.newTaskTitle = '' this.newTaskTitle = ''
this.hideCrateNewTask() this.hideCrateNewTask()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
formatYear(date) { formatYear(date) {
return this.format(date, 'MMMM, yyyy') return this.format(date, 'MMMM, yyyy')

View file

@ -84,9 +84,6 @@ export default {
this.loadedList = JSON.parse(JSON.stringify(currentList)) this.loadedList = JSON.parse(JSON.stringify(currentList))
}) })
.catch(e => {
this.$message.error(e)
})
}, },
loadTasksForPage(e) { loadTasksForPage(e) {

View file

@ -228,9 +228,6 @@ export default {
) )
this.$message.success(r) this.$message.success(r)
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.showDeleteModal = false this.showDeleteModal = false
}) })

View file

@ -227,9 +227,6 @@ export default {
this.comments = r this.comments = r
this.makeActions() this.makeActions()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
addComment() { addComment() {
if (this.newComment.comment === '') { if (this.newComment.comment === '') {
@ -253,9 +250,6 @@ export default {
this.$message.success({message: this.$t('task.comment.addedSuccess')}) this.$message.success({message: this.$t('task.comment.addedSuccess')})
this.makeActions() this.makeActions()
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.creating = false this.creating = false
}) })
@ -289,9 +283,6 @@ export default {
this.saved = null this.saved = null
}, 2000) }, 2000)
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.isCommentEdit = false this.isCommentEdit = false
this.saving = null this.saving = null
@ -307,9 +298,6 @@ export default {
} }
} }
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.showDeleteModal = false this.showDeleteModal = false
}) })

View file

@ -129,9 +129,6 @@ export default {
this.task = r this.task = r
this.$emit('update:modelValue', r) this.$emit('update:modelValue', r)
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -83,9 +83,6 @@ export default {
this.saved = false this.saved = false
}, 2000) }, 2000)
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.saving = false this.saving = false
}) })

View file

@ -84,9 +84,6 @@ export default {
this.$emit('update:modelValue', this.assignees) this.$emit('update:modelValue', this.assignees)
this.$message.success({message: this.$t('task.assignee.assignSuccess')}) this.$message.success({message: this.$t('task.assignee.assignSuccess')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
removeAssignee(user) { removeAssignee(user) {
this.$store.dispatch('tasks/removeAssignee', {user: user, taskId: this.taskId}) this.$store.dispatch('tasks/removeAssignee', {user: user, taskId: this.taskId})
@ -99,9 +96,6 @@ export default {
} }
this.$message.success({message: this.$t('task.assignee.unassignSuccess')}) this.$message.success({message: this.$t('task.assignee.unassignSuccess')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
findUser(query) { findUser(query) {
if (query === '') { if (query === '') {
@ -114,9 +108,6 @@ export default {
// Filter the results to not include users who are already assigned // Filter the results to not include users who are already assigned
this.foundUsers = response.filter(({id}) => !includesById(this.assignees, id)) this.foundUsers = response.filter(({id}) => !includesById(this.assignees, id))
}) })
.catch(e => {
this.$message.error(e)
})
}, },
clearAllFoundUsers() { clearAllFoundUsers() {
this.foundUsers = [] this.foundUsers = []

View file

@ -111,9 +111,6 @@ export default {
this.$message.success({message: this.$t('task.label.addSuccess')}) this.$message.success({message: this.$t('task.label.addSuccess')})
} }
}) })
.catch(e => {
this.$message.error(e)
})
}, },
removeLabel(label) { removeLabel(label) {
const removeFromState = () => { const removeFromState = () => {
@ -136,9 +133,6 @@ export default {
removeFromState() removeFromState()
this.$message.success({message: this.$t('task.label.removeSuccess')}) this.$message.success({message: this.$t('task.label.removeSuccess')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
createAndAddLabel(title) { createAndAddLabel(title) {
if (this.taskId === 0) { if (this.taskId === 0) {
@ -152,9 +146,6 @@ export default {
this.labels.push(r) this.labels.push(r)
this.$message.success({message: this.$t('task.label.addCreateSuccess')}) this.$message.success({message: this.$t('task.label.addCreateSuccess')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },

View file

@ -82,9 +82,6 @@ export default {
this.showSavedMessage = false this.showSavedMessage = false
}, 2000) }, 2000)
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.saving = false this.saving = false
}) })

View file

@ -104,9 +104,6 @@ export default {
playPop() playPop()
} }
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.loadingInternal = false this.loadingInternal = false
}) })

View file

@ -60,9 +60,6 @@ export default {
.then(response => { .then(response => {
this.foundLists = response this.foundLists = response
}) })
.catch(e => {
this.$message.error(e)
})
}, },
clearAll() { clearAll() {
this.foundLists = [] this.foundLists = []

View file

@ -185,14 +185,8 @@ export default {
}, },
}, },
methods: { methods: {
findTasks(query) { async findTasks(query) {
this.taskService.getAll({}, {s: query}) this.foundTasks = await this.taskService.getAll({}, {s: query})
.then(response => {
this.foundTasks = response
})
.catch(e => {
this.$message.error(e)
})
}, },
addTaskRelation() { addTaskRelation() {
let rel = new TaskRelationModel({ let rel = new TaskRelationModel({
@ -213,9 +207,6 @@ export default {
this.saved = false this.saved = false
}, 2000) }, 2000)
}) })
.catch(e => {
this.$message.error(e)
})
}, },
removeTaskRelation() { removeTaskRelation() {
const rel = new TaskRelationModel({ const rel = new TaskRelationModel({
@ -237,9 +228,6 @@ export default {
this.saved = false this.saved = false
}, 2000) }, 2000)
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.showDeleteModal = false this.showDeleteModal = false
}) })
@ -251,9 +239,6 @@ export default {
this.newTaskRelationTask = r this.newTaskRelationTask = r
this.addTaskRelation() this.addTaskRelation()
}) })
.catch(e => {
this.$message.error(e)
})
}, },
relationKindTitle(kind, length) { relationKindTitle(kind, length) {
return this.$tc(`task.relation.kinds.${kind}`, length) return this.$tc(`task.relation.kinds.${kind}`, length)

View file

@ -187,9 +187,6 @@ export default {
}, },
}]) }])
}) })
.catch(e => {
this.$message.error(e)
})
} }
if (checked) { if (checked) {
@ -206,9 +203,6 @@ export default {
this.$emit('task-updated', t) this.$emit('task-updated', t)
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist') this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
}) })
.catch(e => {
this.$message.error(e)
})
}, },
hideDeferDueDatePopup(e) { hideDeferDueDatePopup(e) {
if (this.showDefer) { if (this.showDefer) {

View file

@ -87,12 +87,9 @@ export default {
Cropper, Cropper,
}, },
methods: { methods: {
avatarStatus() { async avatarStatus() {
this.avatarService.get({}) const { avatarProvider } = await this.avatarService.get({})
.then(r => { this.avatarProvider = avatarProvider
this.avatarProvider = r.avatarProvider
})
.catch(e => this.$message.error(e))
}, },
updateAvatarStatus() { updateAvatarStatus() {
const avatarStatus = new AvatarModel({avatarProvider: this.avatarProvider}) const avatarStatus = new AvatarModel({avatarProvider: this.avatarProvider})
@ -101,7 +98,6 @@ export default {
this.$message.success({message: this.$t('user.settings.avatar.statusUpdateSuccess')}) this.$message.success({message: this.$t('user.settings.avatar.statusUpdateSuccess')})
this.$store.commit('auth/reloadAvatar') this.$store.commit('auth/reloadAvatar')
}) })
.catch(e => this.$message.error(e))
}, },
uploadAvatar() { uploadAvatar() {
this.loading = true this.loading = true
@ -114,7 +110,6 @@ export default {
this.$message.success({message: this.$t('user.settings.avatar.setSuccess')}) this.$message.success({message: this.$t('user.settings.avatar.setSuccess')})
this.$store.commit('auth/reloadAvatar') this.$store.commit('auth/reloadAvatar')
}) })
.catch(e => this.$message.error(e))
.finally(() => { .finally(() => {
this.loading = false this.loading = false
this.isCropAvatar = false this.isCropAvatar = false

View file

@ -64,7 +64,6 @@ export default {
this.$message.success({message: this.$t('user.export.success')}) this.$message.success({message: this.$t('user.export.success')})
this.password = '' this.password = ''
}) })
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -113,7 +113,6 @@ export default {
this.$message.success({message: this.$t('user.deletion.requestSuccess')}) this.$message.success({message: this.$t('user.deletion.requestSuccess')})
this.password = '' this.password = ''
}) })
.catch(e => this.$message.error(e))
}, },
cancelDeletion() { cancelDeletion() {
if (this.password === '') { if (this.password === '') {
@ -128,7 +127,6 @@ export default {
this.$store.dispatch('auth/refreshUserInfo') this.$store.dispatch('auth/refreshUserInfo')
this.password = '' this.password = ''
}) })
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -53,9 +53,7 @@ export const refreshToken = (persist: boolean): Promise<AxiosResponse> => {
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => { .catch(e => {
// eslint-disable-next-line throw new Error('Error renewing token: ', { cause: e })
console.log('Error renewing token: ', e)
return Promise.reject(e)
}) })
} }

View file

@ -33,7 +33,7 @@ export const getMigratorFromSlug = (slug: string): Migrator => {
isFileMigrator: true, isFileMigrator: true,
} }
default: default:
throw Error('Unknown migrator slug ' + slug) throw new Error('Unknown migrator slug ' + slug)
} }
} }

View file

@ -96,10 +96,30 @@ app.config.errorHandler = (err, vm, info) => {
// if (import.meta.env.PROD) { // if (import.meta.env.PROD) {
// error(err) // error(err)
// } else { // } else {
console.error(err, vm, info) // console.error(err, vm, info)
error(err)
// } // }
} }
if (import.meta.env.DEV) {
app.config.warnHandler = (msg, vm, info) => {
error(msg)
}
}
// https://stackoverflow.com/a/52076738/15522256
window.addEventListener('error', (err) => {
error(err)
})
window.addEventListener('unhandledrejection', (err) => {
// event.promise contains the promise object
// event.reason contains the reason for the rejection
error(err)
})
app.config.globalProperties.$message = { app.config.globalProperties.$message = {
error, error,
success, success,

View file

@ -105,19 +105,6 @@ export default class AbstractService {
return true return true
} }
/////////////////////
// Global error handler
///////////////////
/**
* Handles the error and rejects the promise.
* @param error
* @returns {Promise<never>}
*/
errorHandler(error) {
return Promise.reject(error)
}
///////////////// /////////////////
// Helper functions // Helper functions
/////////////// ///////////////
@ -284,7 +271,7 @@ export default class AbstractService {
*/ */
get(model, params = {}) { get(model, params = {}) {
if (this.paths.get === '') { if (this.paths.get === '') {
return Promise.reject({message: 'This model is not able to get data.'}) throw new Error('This model is not able to get data.')
} }
return this.getM(this.paths.get, model, params) return this.getM(this.paths.get, model, params)
@ -304,10 +291,7 @@ export default class AbstractService {
model = this.beforeGet(model) model = this.beforeGet(model)
const finalUrl = this.getReplacedRoute(url, model) const finalUrl = this.getReplacedRoute(url, model)
return this.http.get(finalUrl, {params: params}) return this.http.get(finalUrl, {params})
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
const result = this.modelGetFactory(response.data) const result = this.modelGetFactory(response.data)
result.maxRight = Number(response.headers['x-max-right']) result.maxRight = Number(response.headers['x-max-right'])
@ -339,7 +323,7 @@ export default class AbstractService {
*/ */
getAll(model = {}, params = {}, page = 1) { getAll(model = {}, params = {}, page = 1) {
if (this.paths.getAll === '') { if (this.paths.getAll === '') {
return Promise.reject({message: 'This model is not able to get data.'}) throw new Error('This model is not able to get data.')
} }
params.page = page params.page = page
@ -349,9 +333,6 @@ export default class AbstractService {
const finalUrl = this.getReplacedRoute(this.paths.getAll, model) const finalUrl = this.getReplacedRoute(this.paths.getAll, model)
return this.http.get(finalUrl, {params: params}) return this.http.get(finalUrl, {params: params})
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
this.resultCount = Number(response.headers['x-pagination-result-count']) this.resultCount = Number(response.headers['x-pagination-result-count'])
this.totalPages = Number(response.headers['x-pagination-total-pages']) this.totalPages = Number(response.headers['x-pagination-total-pages'])
@ -378,16 +359,13 @@ export default class AbstractService {
*/ */
create(model) { create(model) {
if (this.paths.create === '') { if (this.paths.create === '') {
return Promise.reject({message: 'This model is not able to create data.'}) throw new Error('This model is not able to create data.')
} }
const cancel = this.setLoading() const cancel = this.setLoading()
const finalUrl = this.getReplacedRoute(this.paths.create, model) const finalUrl = this.getReplacedRoute(this.paths.create, model)
return this.http.put(finalUrl, model) return this.http.put(finalUrl, model)
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
const result = this.modelCreateFactory(response.data) const result = this.modelCreateFactory(response.data)
if (typeof model.maxRight !== 'undefined') { if (typeof model.maxRight !== 'undefined') {
@ -411,9 +389,6 @@ export default class AbstractService {
const cancel = this.setLoading() const cancel = this.setLoading()
return this.http.post(url, model) return this.http.post(url, model)
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
const result = this.modelUpdateFactory(response.data) const result = this.modelUpdateFactory(response.data)
if (typeof model.maxRight !== 'undefined') { if (typeof model.maxRight !== 'undefined') {
@ -433,7 +408,7 @@ export default class AbstractService {
*/ */
update(model) { update(model) {
if (this.paths.update === '') { if (this.paths.update === '') {
return Promise.reject({message: 'This model is not able to update data.'}) throw new Error('This model is not able to update data.')
} }
const finalUrl = this.getReplacedRoute(this.paths.update, model) const finalUrl = this.getReplacedRoute(this.paths.update, model)
@ -447,16 +422,13 @@ export default class AbstractService {
*/ */
delete(model) { delete(model) {
if (this.paths.delete === '') { if (this.paths.delete === '') {
return Promise.reject({message: 'This model is not able to delete data.'}) throw new Error('This model is not able to delete data.')
} }
const cancel = this.setLoading() const cancel = this.setLoading()
const finalUrl = this.getReplacedRoute(this.paths.delete, model) const finalUrl = this.getReplacedRoute(this.paths.delete, model)
return this.http.delete(finalUrl, model) return this.http.delete(finalUrl, model)
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
return Promise.resolve(response.data) return Promise.resolve(response.data)
}) })
@ -513,9 +485,6 @@ export default class AbstractService {
}, },
}, },
) )
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
return Promise.resolve(this.modelCreateFactory(response.data)) return Promise.resolve(this.modelCreateFactory(response.data))
}) })

View file

@ -27,8 +27,5 @@ export default class BackgroundUnsplashService extends AbstractService {
.then(response => { .then(response => {
return window.URL.createObjectURL(new Blob([response.data])) return window.URL.createObjectURL(new Blob([response.data]))
}) })
.catch(e => {
return e
})
} }
} }

View file

@ -57,21 +57,13 @@ export default class ListService extends AbstractService {
.then(response => { .then(response => {
return window.URL.createObjectURL(new Blob([response.data])) return window.URL.createObjectURL(new Blob([response.data]))
}) })
.catch(e => {
return e
})
} }
removeBackground(list) { removeBackground(list) {
const cancel = this.setLoading() const cancel = this.setLoading()
return this.http.delete(`/lists/${list.id}/background`, list) return this.http.delete(`/lists/${list.id}/background`, list)
.then(response => { .then(response => response.data)
return Promise.resolve(response.data)
})
.catch(error => {
return this.errorHandler(error)
})
.finally(() => { .finally(() => {
cancel() cancel()
}) })

View file

@ -18,9 +18,6 @@ export default class PasswordResetService extends AbstractService {
resetPassword(model) { resetPassword(model) {
const cancel = this.setLoading() const cancel = this.setLoading()
return this.http.post(this.paths.reset, model) return this.http.post(this.paths.reset, model)
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
return Promise.resolve(this.modelFactory(response.data)) return Promise.resolve(this.modelFactory(response.data))
}) })
@ -32,9 +29,6 @@ export default class PasswordResetService extends AbstractService {
requestResetPassword(model) { requestResetPassword(model) {
const cancel = this.setLoading() const cancel = this.setLoading()
return this.http.post(this.paths.requestReset, model) return this.http.post(this.paths.requestReset, model)
.catch(error => {
return this.errorHandler(error)
})
.then(response => { .then(response => {
return Promise.resolve(this.modelFactory(response.data)) return Promise.resolve(this.modelFactory(response.data))
}) })

View file

@ -159,9 +159,6 @@ export default {
ctx.dispatch('checkAuth') ctx.dispatch('checkAuth')
return Promise.resolve() return Promise.resolve()
}) })
.catch(e => {
return Promise.reject(e)
})
.finally(() => { .finally(() => {
ctx.commit(LOADING, false, {root: true}) ctx.commit(LOADING, false, {root: true})
}) })
@ -174,9 +171,7 @@ export default {
.then(r => { .then(r => {
saveToken(r.data.token, false) saveToken(r.data.token, false)
ctx.dispatch('checkAuth') ctx.dispatch('checkAuth')
return Promise.resolve(r.data) return r.data
}).catch(e => {
return Promise.reject(e)
}) })
}, },
// Populates user information from jwt token saved in local storage in store // Populates user information from jwt token saved in local storage in store
@ -238,7 +233,7 @@ export default {
ctx.commit('lastUserRefresh') ctx.commit('lastUserRefresh')
}) })
.catch(e => { .catch(e => {
console.error('Error while refreshing user info:', e) throw new Error('Error while refreshing user info:', { cause: e })
}) })
}, },
// Renews the api token and saves it to local storage // Renews the api token and saves it to local storage

View file

@ -68,7 +68,6 @@ export default {
ctx.commit(CONFIG, r.data) ctx.commit(CONFIG, r.data)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
}, },
redirectToProviderIfNothingElseIsEnabled(ctx) { redirectToProviderIfNothingElseIsEnabled(ctx) {
if (ctx.state.auth.local.enabled === false && if (ctx.state.auth.local.enabled === false &&

View file

@ -222,14 +222,9 @@ export default {
.then(r => { .then(r => {
ctx.commit('setBuckets', r) ctx.commit('setBuckets', r)
ctx.commit('setListId', listId) ctx.commit('setListId', listId)
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
})
.finally(() => {
cancel()
}) })
.finally(() => cancel())
}, },
loadNextTasksForBucket(ctx, {listId, ps = {}, bucketId}) { loadNextTasksForBucket(ctx, {listId, ps = {}, bucketId}) {
@ -282,10 +277,7 @@ export default {
if (taskService.totalPages <= page) { if (taskService.totalPages <= page) {
ctx.commit('setAllTasksLoadedForBucket', bucketId) ctx.commit('setAllTasksLoadedForBucket', bucketId)
} }
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
.finally(() => { .finally(() => {
cancel() cancel()
@ -300,14 +292,9 @@ export default {
return bucketService.create(bucket) return bucketService.create(bucket)
.then(r => { .then(r => {
ctx.commit('addBucket', r) ctx.commit('addBucket', r)
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
})
.finally(() => {
cancel()
}) })
.finally(() => cancel())
}, },
deleteBucket(ctx, {bucket, params}) { deleteBucket(ctx, {bucket, params}) {
@ -319,14 +306,9 @@ export default {
ctx.commit('removeBucket', bucket) ctx.commit('removeBucket', bucket)
// We reload all buckets because tasks are being moved from the deleted bucket // We reload all buckets because tasks are being moved from the deleted bucket
ctx.dispatch('loadBucketsForList', {listId: bucket.listId, params: params}) ctx.dispatch('loadBucketsForList', {listId: bucket.listId, params: params})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
})
.finally(() => {
cancel()
}) })
.finally(() => cancel())
}, },
updateBucket(ctx, updatedBucketData) { updateBucket(ctx, updatedBucketData) {

View file

@ -91,7 +91,6 @@ export default {
ctx.commit('setLoaded', true) ctx.commit('setLoaded', true)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
deleteLabel(ctx, label) { deleteLabel(ctx, label) {
@ -103,7 +102,6 @@ export default {
ctx.commit('removeLabelById', label) ctx.commit('removeLabelById', label)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
updateLabel(ctx, label) { updateLabel(ctx, label) {
@ -115,7 +113,6 @@ export default {
ctx.commit('setLabel', r) ctx.commit('setLabel', r)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
createLabel(ctx, label) { createLabel(ctx, label) {
@ -127,7 +124,6 @@ export default {
ctx.commit('setLabel', r) ctx.commit('setLabel', r)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
}, },

View file

@ -53,7 +53,6 @@ export default {
ctx.commit('setList', r) ctx.commit('setList', r)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
updateList(ctx, list) { updateList(ctx, list) {
@ -99,10 +98,7 @@ export default {
ctx.commit('removeListById', list) ctx.commit('removeListById', list)
ctx.commit('namespaces/removeListFromNamespaceById', list, {root: true}) ctx.commit('namespaces/removeListFromNamespaceById', list, {root: true})
removeListFromHistory({id: list.id}) removeListFromHistory({id: list.id})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
.finally(() => cancel()) .finally(() => cancel())
}, },

View file

@ -115,7 +115,6 @@ export default {
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => { .finally(() => {
cancel() cancel()
}) })
@ -141,7 +140,6 @@ export default {
ctx.commit('removeNamespaceById', namespace.id) ctx.commit('removeNamespaceById', namespace.id)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
createNamespace(ctx, namespace) { createNamespace(ctx, namespace) {
@ -153,7 +151,6 @@ export default {
ctx.commit('addNamespace', r) ctx.commit('addNamespace', r)
return Promise.resolve(r) return Promise.resolve(r)
}) })
.catch(e => Promise.reject(e))
.finally(() => cancel()) .finally(() => cancel())
}, },
}, },

View file

@ -45,7 +45,6 @@ function addLabelToTask(task, label) {
task.labels.push(label) task.labels.push(label)
return Promise.resolve(result) return Promise.resolve(result)
}) })
.catch(e => Promise.reject(e))
} }
function findAssignees(parsedTaskAssignees) { function findAssignees(parsedTaskAssignees) {
@ -77,9 +76,6 @@ export default {
ctx.commit(HAS_TASKS, r.length > 0, {root: true}) ctx.commit(HAS_TASKS, r.length > 0, {root: true})
return r return r
}) })
.catch(e => {
return Promise.reject(e)
})
.finally(() => { .finally(() => {
cancel() cancel()
}) })
@ -92,10 +88,7 @@ export default {
return taskService.update(task) return taskService.update(task)
.then(t => { .then(t => {
ctx.commit('kanban/setTaskInBucket', t, {root: true}) ctx.commit('kanban/setTaskInBucket', t, {root: true})
return Promise.resolve(t) return t
})
.catch(e => {
return Promise.reject(e)
}) })
.finally(() => { .finally(() => {
cancel() cancel()
@ -106,10 +99,7 @@ export default {
return taskService.delete(task) return taskService.delete(task)
.then(t => { .then(t => {
ctx.commit('kanban/removeTaskInBucket', task, {root: true}) ctx.commit('kanban/removeTaskInBucket', task, {root: true})
return Promise.resolve(t) return t
})
.catch(e => {
return Promise.reject(e)
}) })
}, },
// Adds a task attachment in store. // Adds a task attachment in store.
@ -151,10 +141,7 @@ export default {
// FIXME: direct store manipulation (task) // FIXME: direct store manipulation (task)
t.task.assignees.push(user) t.task.assignees.push(user)
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
}, },
removeAssignee(ctx, {user, taskId}) { removeAssignee(ctx, {user, taskId}) {
@ -182,10 +169,7 @@ export default {
} }
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
}, },
@ -208,10 +192,7 @@ export default {
t.task.labels.push(label) t.task.labels.push(label)
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
}, },
@ -241,10 +222,7 @@ export default {
ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true}) ctx.commit('kanban/setTaskInBucketByIndex', t, {root: true})
return Promise.resolve(r) return r
})
.catch(e => {
return Promise.reject(e)
}) })
}, },
@ -296,7 +274,7 @@ export default {
// 4. If none of the above worked, reject the promise with an error. // 4. If none of the above worked, reject the promise with an error.
if (typeof foundListId === 'undefined' || listId === null) { if (typeof foundListId === 'undefined' || listId === null) {
return Promise.reject('NO_LIST') throw new Error('NO_LIST')
} }
return foundListId return foundListId
@ -336,7 +314,6 @@ export default {
task, task,
parsedLabels:parsedTask.labels, parsedLabels:parsedTask.labels,
})) }))
.catch(e => Promise.reject(e))
}, },
}, },
} }

View file

@ -100,7 +100,6 @@ export default {
this.$store.dispatch('namespaces/loadNamespaces') this.$store.dispatch('namespaces/loadNamespaces')
this.$router.push({name: 'list.index', params: {listId: r.getListId()}}) this.$router.push({name: 'list.index', params: {listId: r.getListId()}})
}) })
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -35,7 +35,6 @@ export default {
this.$message.success({message: this.$t('filters.delete.success')}) this.$message.success({message: this.$t('filters.delete.success')})
this.$router.push({name: 'namespaces.index'}) this.$router.push({name: 'namespaces.index'})
}) })
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -105,7 +105,6 @@ export default {
this.filter = r this.filter = r
this.filters = objectToSnakeCase(this.filter.filters) this.filters = objectToSnakeCase(this.filter.filters)
}) })
.catch(e => this.$message.error(e))
}, },
save() { save() {
this.filter.filters = this.filters this.filter.filters = this.filters
@ -117,7 +116,6 @@ export default {
this.filters = objectToSnakeCase(this.filter.filters) this.filters = objectToSnakeCase(this.filter.filters)
this.$router.back() this.$router.back()
}) })
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -133,27 +133,18 @@ export default {
methods: { methods: {
loadLabels() { loadLabels() {
this.$store.dispatch('labels/loadAllLabels') this.$store.dispatch('labels/loadAllLabels')
.catch(e => {
this.$message.error(e)
})
}, },
deleteLabel(label) { deleteLabel(label) {
this.$store.dispatch('labels/deleteLabel', label) this.$store.dispatch('labels/deleteLabel', label)
.then(() => { .then(() => {
this.$message.success({message: this.$t('label.deleteSuccess')}) this.$message.success({message: this.$t('label.deleteSuccess')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
editLabelSubmit() { editLabelSubmit() {
this.$store.dispatch('labels/updateLabel', this.labelEditLabel) this.$store.dispatch('labels/updateLabel', this.labelEditLabel)
.then(() => { .then(() => {
this.$message.success({message: this.$t('label.edit.success')}) this.$message.success({message: this.$t('label.edit.success')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
editLabel(label) { editLabel(label) {
if (label.createdBy.id !== this.userInfo.id) { if (label.createdBy.id !== this.userInfo.id) {

View file

@ -75,9 +75,6 @@ export default {
}) })
this.$message.success({message: this.$t('label.create.success')}) this.$message.success({message: this.$t('label.create.success')})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -71,9 +71,6 @@ export default {
params: { listId: r.id }, params: { listId: r.id },
}) })
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -144,9 +144,6 @@ export default {
this.$store.dispatch(CURRENT_LIST, r) this.$store.dispatch(CURRENT_LIST, r)
this.setTitle(this.getListTitle(r)) this.setTitle(this.getListTitle(r))
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.listLoaded = this.$route.params.listId this.listLoaded = this.$route.params.listId
}) })

View file

@ -42,9 +42,6 @@ export default {
this.$store.commit('namespaces/setListInNamespaceById', r) this.$store.commit('namespaces/setListInNamespaceById', r)
this.$message.success({message: this.$t('list.archive.success')}) this.$message.success({message: this.$t('list.archive.success')})
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.$router.back() this.$router.back()
}) })

View file

@ -128,9 +128,6 @@ export default {
}) })
}) })
}) })
.catch(e => {
this.$message.error(e)
})
}, 300) }, 300)
}, },
setBackground(backgroundId) { setBackground(backgroundId) {
@ -145,9 +142,6 @@ export default {
this.$store.commit('namespaces/setListInNamespaceById', l) this.$store.commit('namespaces/setListInNamespaceById', l)
this.$message.success({message: this.$t('list.background.success')}) this.$message.success({message: this.$t('list.background.success')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
uploadBackground() { uploadBackground() {
if (this.$refs.backgroundUploadInput.files.length === 0) { if (this.$refs.backgroundUploadInput.files.length === 0) {
@ -160,9 +154,6 @@ export default {
this.$store.commit('namespaces/setListInNamespaceById', l) this.$store.commit('namespaces/setListInNamespaceById', l)
this.$message.success({message: this.$t('list.background.success')}) this.$message.success({message: this.$t('list.background.success')})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
removeBackground() { removeBackground() {
this.listService.removeBackground(this.currentList) this.listService.removeBackground(this.currentList)
@ -172,9 +163,6 @@ export default {
this.$message.success({message: this.$t('list.background.removeSuccess')}) this.$message.success({message: this.$t('list.background.removeSuccess')})
this.$router.back() this.$router.back()
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -30,9 +30,6 @@ export default {
this.$message.success({message: this.$t('list.delete.success')}) this.$message.success({message: this.$t('list.delete.success')})
this.$router.push({name: 'home'}) this.$router.push({name: 'home'})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -50,9 +50,6 @@ export default {
this.$message.success({message: this.$t('list.duplicate.success')}) this.$message.success({message: this.$t('list.duplicate.success')})
this.$router.push({name: 'list.index', params: {listId: r.list.id}}) this.$router.push({name: 'list.index', params: {listId: r.list.id}})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -101,9 +101,6 @@ export default {
.then(r => { .then(r => {
this.list = { ...r } this.list = { ...r }
}) })
.catch(e => {
this.$message.error(e)
})
}, },
save() { save() {
this.$store.dispatch('lists/updateList', this.list) this.$store.dispatch('lists/updateList', this.list)
@ -113,9 +110,6 @@ export default {
this.$message.success({message: this.$t('list.edit.success')}) this.$message.success({message: this.$t('list.edit.success')})
this.$router.back() this.$router.back()
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -68,9 +68,6 @@ export default {
this.manageUsersComponent = 'userTeam' this.manageUsersComponent = 'userTeam'
this.setTitle(this.$t('list.share.title', {list: this.list.title})) this.setTitle(this.$t('list.share.title', {list: this.list.title}))
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -565,7 +565,6 @@ export default {
} }
this.$store.dispatch('kanban/updateBucket', newBucket) this.$store.dispatch('kanban/updateBucket', newBucket)
.then(() => this.$message.success({message: this.$t('list.kanban.doneBucketSavedSuccess')})) .then(() => this.$message.success({message: this.$t('list.kanban.doneBucketSavedSuccess')}))
.catch(e => this.$message.error(e))
}, },
collapseBucket(bucket) { collapseBucket(bucket) {
this.collapsedBuckets[bucket.id] = true this.collapsedBuckets[bucket.id] = true

View file

@ -307,9 +307,6 @@ export default {
.then(r => { .then(r => {
this.tasks[e.newIndex] = r this.tasks[e.newIndex] = r
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -77,9 +77,6 @@ export default {
this.$message.success({message: this.$t('namespace.create.success') }) this.$message.success({message: this.$t('namespace.create.success') })
this.$router.back() this.$router.back()
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -40,9 +40,6 @@ export default {
this.$store.commit('namespaces/setNamespaceById', r) this.$store.commit('namespaces/setNamespaceById', r)
this.$message.success({message: this.$t('namespace.archive.success')}) this.$message.success({message: this.$t('namespace.archive.success')})
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.$router.back() this.$router.back()
}) })

View file

@ -41,9 +41,6 @@ export default {
this.$message.success({message: this.$t('namespace.delete.success')}) this.$message.success({message: this.$t('namespace.delete.success')})
this.$router.push({name: 'home'}) this.$router.push({name: 'home'})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -112,9 +112,6 @@ export default {
this.title = this.$t('namespace.edit.title', {namespace: r.title}) this.title = this.$t('namespace.edit.title', {namespace: r.title})
this.setTitle(this.title) this.setTitle(this.title)
}) })
.catch(e => {
this.$message.error(e)
})
}, },
save() { save() {
this.namespaceService.update(this.namespace) this.namespaceService.update(this.namespace)
@ -124,9 +121,6 @@ export default {
this.$message.success({message: this.$t('namespace.edit.success')}) this.$message.success({message: this.$t('namespace.edit.success')})
this.$router.back() this.$router.back()
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -68,9 +68,6 @@ export default {
this.title = this.$t('namespace.share.title', { namespace: this.namespace.title }) this.title = this.$t('namespace.share.title', { namespace: this.namespace.title })
this.setTitle(this.title) this.setTitle(this.title)
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -211,9 +211,6 @@ export default {
this.tasks = tasks this.tasks = tasks
}) })
.catch(e => {
this.$message.error(e)
})
}, },
updateTasks(updatedTask) { updateTasks(updatedTask) {
for (const t in this.tasks) { for (const t in this.tasks) {

View file

@ -574,9 +574,6 @@ export default {
this.setActiveFields() this.setActiveFields()
this.setTitle(this.task.title) this.setTitle(this.task.title)
}) })
.catch(e => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.$nextTick(() => this.visible = true) this.$nextTick(() => this.visible = true)
this.scrollToHeading() this.scrollToHeading()
@ -620,25 +617,21 @@ export default {
this.task.endDate = this.task.dueDate this.task.endDate = this.task.dueDate
} }
try { this.task = await this.$store.dispatch('tasks/update', this.task)
this.task = await this.$store.dispatch('tasks/update', this.task) this.setActiveFields()
this.setActiveFields()
if (!showNotification) { if (!showNotification) {
return return
}
let actions = []
if (undoCallback !== null) {
actions = [{
title: 'Undo',
callback: undoCallback,
}]
}
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
} catch(e) {
this.$message.error(e)
} }
let actions = []
if (undoCallback !== null) {
actions = [{
title: 'Undo',
callback: undoCallback,
}]
}
this.$message.success({message: this.$t('task.detail.updateSuccess')}, actions)
}, },
setFieldActive(fieldName) { setFieldActive(fieldName) {
this.activeFields[fieldName] = true this.activeFields[fieldName] = true
@ -664,9 +657,6 @@ export default {
this.$message.success({message: this.$t('task.detail.deleteSuccess')}) this.$message.success({message: this.$t('task.detail.deleteSuccess')})
this.$router.push({name: 'list.index', params: {listId: this.task.listId}}) this.$router.push({name: 'list.index', params: {listId: this.task.listId}})
}) })
.catch(e => {
this.$message.error(e)
})
}, },
toggleTaskDone() { toggleTaskDone() {
this.task.done = !this.task.done this.task.done = !this.task.done
@ -705,9 +695,6 @@ export default {
this.task = t this.task = t
this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist') this.$store.dispatch('namespaces/loadNamespacesIfFavoritesDontExist')
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -229,9 +229,6 @@ export default {
this.title = this.$t('team.edit.title', {team: this.team.name}) this.title = this.$t('team.edit.title', {team: this.team.name})
this.setTitle(this.title) this.setTitle(this.title)
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
save() { save() {
if (this.team.name === '') { if (this.team.name === '') {
@ -246,9 +243,6 @@ export default {
this.team = response this.team = response
this.$message.success({message: this.$t('team.edit.success')}) this.$message.success({message: this.$t('team.edit.success')})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
deleteTeam() { deleteTeam() {
this.teamService this.teamService
@ -257,9 +251,6 @@ export default {
this.$message.success({message: this.$t('team.edit.delete.success')}) this.$message.success({message: this.$t('team.edit.delete.success')})
this.$router.push({name: 'teams.index'}) this.$router.push({name: 'teams.index'})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
deleteUser() { deleteUser() {
this.teamMemberService this.teamMemberService
@ -268,9 +259,6 @@ export default {
this.$message.success({message: this.$t('team.edit.deleteUser.success')}) this.$message.success({message: this.$t('team.edit.deleteUser.success')})
this.loadTeam() this.loadTeam()
}) })
.catch((e) => {
this.$message.error(e)
})
.finally(() => { .finally(() => {
this.showUserDeleteModal = false this.showUserDeleteModal = false
}) })
@ -286,9 +274,6 @@ export default {
this.loadTeam() this.loadTeam()
this.$message.success({message: this.$t('team.edit.userAddedSuccess')}) this.$message.success({message: this.$t('team.edit.userAddedSuccess')})
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
toggleUserType(member) { toggleUserType(member) {
member.admin = !member.admin member.admin = !member.admin
@ -308,9 +293,6 @@ export default {
this.$t('team.edit.madeMember'), this.$t('team.edit.madeMember'),
}) })
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
findUser(query) { findUser(query) {
if (query === '') { if (query === '') {
@ -323,9 +305,6 @@ export default {
.then((response) => { .then((response) => {
this.foundUsers = response this.foundUsers = response
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
clearAll() { clearAll() {
this.foundUsers = [] this.foundUsers = []

View file

@ -48,9 +48,6 @@ export default {
.then(response => { .then(response => {
this.teams = response this.teams = response
}) })
.catch(e => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -65,9 +65,6 @@ export default {
}) })
this.$message.success({message: this.$t('team.create.success') }) this.$message.success({message: this.$t('team.create.success') })
}) })
.catch((e) => {
this.$message.error(e)
})
}, },
}, },
} }

View file

@ -57,7 +57,6 @@ export default {
} }
this.dataExportService.download(this.password) this.dataExportService.download(this.password)
.catch(e => this.$message.error(e))
}, },
}, },
} }

View file

@ -147,7 +147,6 @@ export default {
} }
this.$store.dispatch('auth/register', credentials) this.$store.dispatch('auth/register', credentials)
.catch(() => {})
}, },
}, },
} }

View file

@ -395,14 +395,12 @@ export default {
.then(() => { .then(() => {
this.$message.success({message: this.$t('user.settings.passwordUpdateSuccess')}) this.$message.success({message: this.$t('user.settings.passwordUpdateSuccess')})
}) })
.catch(e => this.$message.error(e))
}, },
updateEmail() { updateEmail() {
this.emailUpdateService.update(this.emailUpdate) this.emailUpdateService.update(this.emailUpdate)
.then(() => { .then(() => {
this.$message.success({message: this.$t('user.settings.updateEmailSuccess')}) this.$message.success({message: this.$t('user.settings.updateEmailSuccess')})
}) })
.catch(e => this.$message.error(e))
}, },
totpStatus() { totpStatus() {
if (!this.totpEnabled) { if (!this.totpEnabled) {
@ -420,7 +418,7 @@ export default {
return return
} }
this.$message.error(e) throw e
}) })
}, },
totpSetQrCode() { totpSetQrCode() {
@ -437,7 +435,6 @@ export default {
this.totp = r this.totp = r
this.totpSetQrCode() this.totpSetQrCode()
}) })
.catch(e => this.$message.error(e))
}, },
totpConfirm() { totpConfirm() {
this.totpService.enable({passcode: this.totpConfirmPasscode}) this.totpService.enable({passcode: this.totpConfirmPasscode})
@ -445,7 +442,6 @@ export default {
this.totp.enabled = true this.totp.enabled = true
this.$message.success({message: this.$t('user.settings.totp.confirmSuccess')}) this.$message.success({message: this.$t('user.settings.totp.confirmSuccess')})
}) })
.catch(e => this.$message.error(e))
}, },
totpDisable() { totpDisable() {
this.totpService.disable({password: this.totpDisablePassword}) this.totpService.disable({password: this.totpDisablePassword})
@ -454,7 +450,6 @@ export default {
this.totp = new TotpModel() this.totp = new TotpModel()
this.$message.success({message: this.$t('user.settings.totp.disableSuccess')}) this.$message.success({message: this.$t('user.settings.totp.disableSuccess')})
}) })
.catch(e => this.$message.error(e))
}, },
updateSettings() { updateSettings() {
localStorage.setItem(playSoundWhenDoneKey, this.playSoundWhenDone) localStorage.setItem(playSoundWhenDoneKey, this.playSoundWhenDone)
@ -467,7 +462,6 @@ export default {
this.$store.commit('auth/setUserSettings', this.settings) this.$store.commit('auth/setUserSettings', this.settings)
this.$message.success({message: this.$t('user.settings.general.savedSuccess')}) this.$message.success({message: this.$t('user.settings.general.savedSuccess')})
}) })
.catch(e => this.$message.error(e))
}, },
anchorHashCheck() { anchorHashCheck() {
if (window.location.hash === this.$route.hash) { if (window.location.hash === this.$route.hash) {