aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-02-08 22:17:53 -0500
committertaehoon <th.dev91@gmail.com>2019-02-15 13:34:33 -0500
commit2de756aa0c27ae5267032e07c2e1f998d49d0df5 (patch)
treefa53a5be59371b977e2553bb001cba2043b70ac8 /src/components
parent2132d58075c71bd8a445288d052cc05e321fdf24 (diff)
Better error handling
Diffstat (limited to 'src/components')
-rw-r--r--src/components/image_cropper/image_cropper.js3
-rw-r--r--src/components/image_cropper/image_cropper.vue2
-rw-r--r--src/components/user_settings/user_settings.js2
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 @@
<i class="icon-spin4 animate-spin" v-if="submitting"></i>
</div>
<div class="alert error" v-if="submitError">
- Error: {{ submitError }}
+ {{submitErrorMsg}}
<i class="button-icon icon-cancel" @click="clearError"></i>
</div>
</div>
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)
}
})
},