We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1f281c commit fab7d56Copy full SHA for fab7d56
site/src/modules/resources/DownloadAgentLogsButton.tsx
@@ -44,16 +44,15 @@ export const DownloadAgentLogsButton: FC<DownloadAgentLogsButtonProps> = ({
44
setIsDownloading(true);
45
const logs = await fetchLogs();
46
if (!logs) {
47
- displayError("Failed to fetch logs");
48
- setIsDownloading(false);
49
- return;
+ throw new Error("No logs found");
50
}
51
const text = logs.map((l) => l.output).join("\n");
52
const file = new Blob([text], { type: "text/plain" });
53
download(file, `${agent.name}-logs.txt`);
54
55
} catch (e) {
+ console.error(e);
56
displayError("Failed to download logs");
+ } finally {
57
setIsDownloading(false);
58
59
}}
0 commit comments