Skip to content

Commit

Permalink
fix: show error reason to user
Browse files Browse the repository at this point in the history
Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
  • Loading branch information
DorraJaouad committed Dec 6, 2024
1 parent bf5a75d commit 4af1bc0
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ export default {
isLoading: true,
success: false,
error: false,
errorReason: '',
password: '',
listable: CONVERSATION.LISTABLE.NONE,
isAvatarEdited: false,
Expand Down Expand Up @@ -216,6 +217,9 @@ export default {
if (this.isLoading) {
return t('spreed', 'Creating the conversation …')
} else if (this.error) {
if (this.errorReason === 'password_required') {
return t('spreed', 'Error: A password is required to create the conversation.')
}
return t('spreed', 'Error while creating the conversation')
} else if (this.success && this.isPublic) {
return t('spreed', 'All set, the conversation "{conversationName}" was created.', { conversationName: this.conversationName })
Expand Down Expand Up @@ -322,6 +326,7 @@ export default {
console.error('Error creating new conversation: ', exception)
this.isLoading = false
this.error = true
this.errorReason = exception.message
// Stop the execution of the method on exceptions.
return
}
Expand Down

0 comments on commit 4af1bc0

Please sign in to comment.