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";
19
19
import type { DistributionProvider } from "./distribution" ;
20
20
import { FindDistributionResultKind } from "./distribution" ;
21
21
import {
22
+ asError ,
22
23
assertNever ,
23
24
getErrorMessage ,
24
25
getErrorStack ,
@@ -851,7 +852,7 @@ export class CodeQLCliServer implements Disposable {
851
852
silent ,
852
853
) . then ( resolve , reject ) ;
853
854
} catch ( err ) {
854
- reject ( err ) ;
855
+ reject ( asError ( err ) ) ;
855
856
}
856
857
} ;
857
858
// If the server is not running a command, then run the given command immediately,
Original file line number Diff line number Diff line change 1
1
import { stat } from "fs/promises" ;
2
2
import { createReadStream } from "fs-extra" ;
3
3
import type { BaseLogger } from "./logging" ;
4
+ import { asError } from "./helpers-pure" ;
4
5
5
6
const doubleLineBreakRegexp = / \n \r ? \n / ;
6
7
@@ -41,7 +42,7 @@ export async function readJsonlFile<T>(
41
42
stream . resume ( ) ;
42
43
} catch ( e ) {
43
44
stream . destroy ( ) ;
44
- reject ( e ) ;
45
+ reject ( asError ( e ) ) ;
45
46
}
46
47
}
47
48
} ) ;
@@ -53,7 +54,7 @@ export async function readJsonlFile<T>(
53
54
void logger ?. log ( `Finished parsing ${ path } ` ) ;
54
55
resolve ( ) ;
55
56
} catch ( e ) {
56
- reject ( e ) ;
57
+ reject ( asError ( e ) ) ;
57
58
}
58
59
} ) ;
59
60
stream . on ( "error" , reject ) ;
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { Transform } from "stream";
5
5
import { dirname , join } from "path" ;
6
6
import type { WriteStream } from "fs" ;
7
7
import { createWriteStream , ensureDir } from "fs-extra" ;
8
+ import { asError } from "./helpers-pure" ;
8
9
9
10
// We can't use promisify because it picks up the wrong overload.
10
11
export function openZip (
@@ -47,7 +48,7 @@ export function readZipEntries(zipFile: ZipFile): Promise<ZipEntry[]> {
47
48
} ) ;
48
49
49
50
zipFile . on ( "error" , ( err ) => {
50
- reject ( err ) ;
51
+ reject ( asError ( err ) ) ;
51
52
} ) ;
52
53
} ) ;
53
54
}
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ import {
42
42
AUTOFIX_PATH ,
43
43
AUTOFIX_MODEL ,
44
44
} from "../config" ;
45
- import { getErrorMessage } from "../common/helpers-pure" ;
45
+ import { asError , getErrorMessage } from "../common/helpers-pure" ;
46
46
import { createTimeoutSignal } from "../common/fetch-stream" ;
47
47
import { unzipToDirectoryConcurrently } from "../common/unzip-concurrently" ;
48
48
import { reportUnzipProgress } from "../common/vscode/unzip-progress" ;
@@ -819,7 +819,7 @@ function execAutofix(
819
819
}
820
820
} ) ;
821
821
} catch ( e ) {
822
- reject ( e ) ;
822
+ reject ( asError ( e ) ) ;
823
823
}
824
824
} ) ;
825
825
}
You can’t perform that action at this time.
0 commit comments