diff --git a/querybook/webapp/lib/datasource.ts b/querybook/webapp/lib/datasource.ts index 0823dc39a..af387e393 100644 --- a/querybook/webapp/lib/datasource.ts +++ b/querybook/webapp/lib/datasource.ts @@ -177,7 +177,7 @@ function streamDatasource( url: string, params?: Record, onStreaming?: (data: { [key: string]: string }) => void, - onStreamingEnd?: (data?: { [key: string]: string }) => void + onStreamingEnd?: (data: { [key: string]: string }) => void ) { const eventSource = new EventSource( `${url}?params=${JSON.stringify(params)}` @@ -191,7 +191,7 @@ function streamDatasource( eventSource.addEventListener('error', (e) => { console.error(e); eventSource.close(); - onStreamingEnd?.(); + onStreamingEnd?.(parser.result); if (e instanceof MessageEvent) { toast.error(JSON.parse(e.data).data); }