make unauthorized error user-friendly

This commit is contained in:
uwaa 2025-01-24 04:16:05 +00:00
parent ceb17dd7eb
commit a29ac91125
2 changed files with 3 additions and 0 deletions

View file

@ -157,6 +157,8 @@ const UserProfile = {
const errorMessage = get(reason, 'error.error')
if (errorMessage === 'No user with such user_id') { // Known error
this.error = this.$t('user_profile.profile_does_not_exist')
} else if (errorMessage == 'This API requires an authenticated user') {
this.error = this.$t('user_profile.unauthorized')
} else if (errorMessage) {
this.error = errorMessage
} else {

View file

@ -1202,6 +1202,7 @@
"user_profile": {
"profile_does_not_exist": "Sorry, this profile does not exist.",
"profile_loading_error": "Sorry, there was an error loading this profile.",
"unauthorized": "Please log in to view this profile.",
"timeline_title": "User timeline",
"field_validated": "Link Verified"
},