Pull out GithubApiError and GithubRateLimitedError to a separate file
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
||||
import { unzipToDirectoryConcurrently } from "../common/unzip-concurrently";
|
||||
import { reportUnzipProgress } from "../common/vscode/unzip-progress";
|
||||
import { Release, ReleaseAsset } from "./release";
|
||||
import { GithubRateLimitedError, GithubApiError } from "./github-api-error";
|
||||
|
||||
/**
|
||||
* distribution.ts
|
||||
@@ -958,22 +959,3 @@ export interface GithubReleaseAsset {
|
||||
*/
|
||||
size: number;
|
||||
}
|
||||
|
||||
export class GithubApiError extends Error {
|
||||
constructor(
|
||||
public status: number,
|
||||
public body: string,
|
||||
) {
|
||||
super(`API call failed with status code ${status}, body: ${body}`);
|
||||
}
|
||||
}
|
||||
|
||||
export class GithubRateLimitedError extends GithubApiError {
|
||||
constructor(
|
||||
public status: number,
|
||||
public body: string,
|
||||
public rateLimitResetDate: Date,
|
||||
) {
|
||||
super(status, body);
|
||||
}
|
||||
}
|
||||
|
||||
18
extensions/ql-vscode/src/codeql-cli/github-api-error.ts
Normal file
18
extensions/ql-vscode/src/codeql-cli/github-api-error.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export class GithubApiError extends Error {
|
||||
constructor(
|
||||
public status: number,
|
||||
public body: string,
|
||||
) {
|
||||
super(`API call failed with status code ${status}, body: ${body}`);
|
||||
}
|
||||
}
|
||||
|
||||
export class GithubRateLimitedError extends GithubApiError {
|
||||
constructor(
|
||||
public status: number,
|
||||
public body: string,
|
||||
public rateLimitResetDate: Date,
|
||||
) {
|
||||
super(status, body);
|
||||
}
|
||||
}
|
||||
@@ -53,9 +53,11 @@ import {
|
||||
DistributionUpdateCheckResultKind,
|
||||
FindDistributionResult,
|
||||
FindDistributionResultKind,
|
||||
} from "./codeql-cli/distribution";
|
||||
import {
|
||||
GithubApiError,
|
||||
GithubRateLimitedError,
|
||||
} from "./codeql-cli/distribution";
|
||||
} from "./codeql-cli/github-api-error";
|
||||
import { tmpDir, tmpDirDisposal } from "./tmp-dir";
|
||||
import { prepareCodeTour } from "./code-tour/code-tour";
|
||||
import {
|
||||
|
||||
Reference in New Issue
Block a user