From 2de756aa0c27ae5267032e07c2e1f998d49d0df5 Mon Sep 17 00:00:00 2001
From: taehoon
Date: Fri, 8 Feb 2019 22:17:53 -0500
Subject: [PATCH] Better error handling
---
src/components/image_cropper/image_cropper.js | 3 +++
src/components/image_cropper/image_cropper.vue | 2 +-
src/components/user_settings/user_settings.js | 2 +-
3 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/components/image_cropper/image_cropper.js b/src/components/image_cropper/image_cropper.js
index 4eaa08d4..da94427a 100644
--- a/src/components/image_cropper/image_cropper.js
+++ b/src/components/image_cropper/image_cropper.js
@@ -50,6 +50,9 @@ const ImageCropper = {
},
cancelText () {
return this.cancelButtonLabel || this.$t('image_cropper.cancel')
+ },
+ submitErrorMsg () {
+ return this.submitError && this.submitError instanceof Error ? this.submitError.toString() : this.submitError
}
},
methods: {
diff --git a/src/components/image_cropper/image_cropper.vue b/src/components/image_cropper/image_cropper.vue
index aa895863..24a6f3bd 100644
--- a/src/components/image_cropper/image_cropper.vue
+++ b/src/components/image_cropper/image_cropper.vue
@@ -10,7 +10,7 @@
- Error: {{ submitError }}
+ {{submitErrorMsg}}
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index c1c60102..dce3eeed 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -124,7 +124,7 @@ const UserSettings = {
this.$store.commit('addNewUsers', [user])
this.$store.commit('setCurrentUser', user)
} else {
- throw this.$t('upload.error.base') + user.error
+ throw new Error(this.$t('upload.error.base') + user.error)
}
})
},