refactor: remove useless try/catch wrappers

移除了 3 个无用的 try/catch 包装器:
- users.ts: 移除只重新抛出错误的外层 try/catch
- FileManager.tsx: 移除只重新抛出错误的内层 try/catch
- DiffViewer.tsx: 移除只重新抛出错误的内层 try/catch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-10-05 21:37:34 +08:00
parent 57a99ae31b
commit f3fde836bc
3 changed files with 106 additions and 118 deletions
-4
View File
@@ -28,7 +28,6 @@ async function verifyOIDCToken(
issuerUrl: string,
clientId: string,
): Promise<any> {
try {
const normalizedIssuerUrl = issuerUrl.endsWith("/")
? issuerUrl.slice(0, -1)
: issuerUrl;
@@ -112,9 +111,6 @@ async function verifyOIDCToken(
});
return payload;
} catch (error) {
throw error;
}
}
const router = express.Router();
@@ -710,7 +710,6 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
try {
const currentSessionId = sshSessionId;
try {
const status = await getSSHStatus(currentSessionId);
if (!status.connected) {
const result = await connectSSH(currentSessionId, {
@@ -729,9 +728,6 @@ function FileManagerContent({ initialHost, onClose }: FileManagerProps) {
throw new Error(t("fileManager.failedToReconnectSSH"));
}
}
} catch (sessionErr) {
throw sessionErr;
}
const symlinkInfo = await identifySSHSymlink(currentSessionId, file.path);
@@ -62,7 +62,6 @@ export function DiffViewer({
});
}
} catch (error) {
try {
await connectSSH(sshSessionId, {
hostId: sshHost.id,
ip: sshHost.ip,
@@ -75,9 +74,6 @@ export function DiffViewer({
credentialId: sshHost.credentialId,
userId: sshHost.userId,
});
} catch (reconnectError) {
throw reconnectError;
}
}
};