few tweaks from greptile comments

This commit is contained in:
dal 2025-08-14 10:19:40 -06:00
parent 0428552454
commit f8f9f4b0e0
No known key found for this signature in database
GPG Key ID: 16F4B0E1E9F61122
5 changed files with 6 additions and 8 deletions

View File

@ -74,7 +74,7 @@ export async function downloadMetricFileHandler(
// Check for timeout
if (Date.now() - startTime > timeout) {
throw new HTTPException(504, {
message: 'Export took too long to complete. Please try again with a smaller date range.',
message: 'Export took too long to complete. Please try again with less data.',
});
}

View File

@ -17,11 +17,7 @@ const app = new Hono()
const response = await downloadMetricFileHandler(id, user);
// Option 1: Return JSON with download URL for client to handle
return c.json(response);
// Option 2: Redirect directly to download URL (uncomment if preferred)
// return c.redirect(response.downloadUrl);
})
// Error handler for metric_files routes

View File

@ -85,7 +85,7 @@ export async function bulkRemoveAssetPermissions(
)
.returning();
return deleted as AssetPermission[];
return deleted;
}
/**

View File

@ -56,6 +56,8 @@ export async function getMetricForExport(input: GetMetricForExportInput): Promis
// The content structure may vary, so we check multiple possible locations
let sql: string | undefined;
//TODO: we need to use the metric type when we merge in the new ai sdk v5 branch date: 08/14/2025
if (typeof result.content === 'object' && result.content !== null) {
// Check common locations for SQL in metric content
const content = result.content as Record<string, unknown>;

View File

@ -34,8 +34,8 @@ export async function getDataSourceCredentials(
// Parse and return the credentials
try {
return JSON.parse(secretString);
} catch (parseError) {
console.error(parseError);
} catch {
// Don't log the parse error as it may contain sensitive credential information
throw new Error(
`Failed to parse credentials for data source ID ${validated.dataSourceId}: Invalid JSON format`
);