Handle caught exceptions properly in catch blocks (S2486)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -269,7 +269,7 @@ export const useAcctMgmtStore = defineStore('acctMgmtStore', {
|
||||
this.currentViewingUser = response.data;
|
||||
this.currentViewingUser.is_admin = response.data.roles?.some(role => role.code === 'admin') ?? false;
|
||||
return response.status === 200;
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// No need to show an error, because an error here means the account is unique
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -87,6 +87,7 @@ export const useLoginStore = defineStore("loginStore", {
|
||||
}
|
||||
this.$router.push("/files");
|
||||
} catch (error) {
|
||||
console.error("Login failed:", error);
|
||||
this.isInvalid = true;
|
||||
}
|
||||
},
|
||||
@@ -132,6 +133,7 @@ export const useLoginStore = defineStore("loginStore", {
|
||||
try {
|
||||
await apiClient.get(api);
|
||||
} catch (error) {
|
||||
console.error("Session check failed:", error);
|
||||
this.$router.push("/login");
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user