File tree Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Expand file tree Collapse file tree 4 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ import type { CliConfig } from "../config";
1919import type { DistributionProvider } from "./distribution" ;
2020import { FindDistributionResultKind } from "./distribution" ;
2121import {
22+ asError ,
2223 assertNever ,
2324 getErrorMessage ,
2425 getErrorStack ,
@@ -851,7 +852,7 @@ export class CodeQLCliServer implements Disposable {
851852 silent ,
852853 ) . then ( resolve , reject ) ;
853854 } catch ( err ) {
854- reject ( err ) ;
855+ reject ( asError ( err ) ) ;
855856 }
856857 } ;
857858 // If the server is not running a command, then run the given command immediately,
Original file line number Diff line number Diff line change 11import { stat } from "fs/promises" ;
22import { createReadStream } from "fs-extra" ;
33import type { BaseLogger } from "./logging" ;
4+ import { asError } from "./helpers-pure" ;
45
56const doubleLineBreakRegexp = / \n \r ? \n / ;
67
@@ -41,7 +42,7 @@ export async function readJsonlFile<T>(
4142 stream . resume ( ) ;
4243 } catch ( e ) {
4344 stream . destroy ( ) ;
44- reject ( e ) ;
45+ reject ( asError ( e ) ) ;
4546 }
4647 }
4748 } ) ;
@@ -53,7 +54,7 @@ export async function readJsonlFile<T>(
5354 void logger ?. log ( `Finished parsing ${ path } ` ) ;
5455 resolve ( ) ;
5556 } catch ( e ) {
56- reject ( e ) ;
57+ reject ( asError ( e ) ) ;
5758 }
5859 } ) ;
5960 stream . on ( "error" , reject ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Transform } from "stream";
55import { dirname , join } from "path" ;
66import type { WriteStream } from "fs" ;
77import { createWriteStream , ensureDir } from "fs-extra" ;
8+ import { asError } from "./helpers-pure" ;
89
910// We can't use promisify because it picks up the wrong overload.
1011export function openZip (
@@ -47,7 +48,7 @@ export function readZipEntries(zipFile: ZipFile): Promise<ZipEntry[]> {
4748 } ) ;
4849
4950 zipFile . on ( "error" , ( err ) => {
50- reject ( err ) ;
51+ reject ( asError ( err ) ) ;
5152 } ) ;
5253 } ) ;
5354}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ import {
4242 AUTOFIX_PATH ,
4343 AUTOFIX_MODEL ,
4444} from "../config" ;
45- import { getErrorMessage } from "../common/helpers-pure" ;
45+ import { asError , getErrorMessage } from "../common/helpers-pure" ;
4646import { createTimeoutSignal } from "../common/fetch-stream" ;
4747import { unzipToDirectoryConcurrently } from "../common/unzip-concurrently" ;
4848import { reportUnzipProgress } from "../common/vscode/unzip-progress" ;
@@ -819,7 +819,7 @@ function execAutofix(
819819 }
820820 } ) ;
821821 } catch ( e ) {
822- reject ( e ) ;
822+ reject ( asError ( e ) ) ;
823823 }
824824 } ) ;
825825}
You can’t perform that action at this time.
0 commit comments