mirror of https://github.com/buster-so/buster.git
few tweaks from greptile comments
This commit is contained in:
parent
0428552454
commit
f8f9f4b0e0
|
@ -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.',
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -85,7 +85,7 @@ export async function bulkRemoveAssetPermissions(
|
|||
)
|
||||
.returning();
|
||||
|
||||
return deleted as AssetPermission[];
|
||||
return deleted;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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>;
|
||||
|
|
|
@ -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`
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue