Skip to content

Commit fab7d56

Browse files
committed
Apply Asher suggestions
1 parent c1f281c commit fab7d56

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

site/src/modules/resources/DownloadAgentLogsButton.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,15 @@ export const DownloadAgentLogsButton: FC<DownloadAgentLogsButtonProps> = ({
4444
setIsDownloading(true);
4545
const logs = await fetchLogs();
4646
if (!logs) {
47-
displayError("Failed to fetch logs");
48-
setIsDownloading(false);
49-
return;
47+
throw new Error("No logs found");
5048
}
5149
const text = logs.map((l) => l.output).join("\n");
5250
const file = new Blob([text], { type: "text/plain" });
5351
download(file, `${agent.name}-logs.txt`);
54-
setIsDownloading(false);
5552
} catch (e) {
53+
console.error(e);
5654
displayError("Failed to download logs");
55+
} finally {
5756
setIsDownloading(false);
5857
}
5958
}}

0 commit comments

Comments
 (0)