mirror of
https://github.com/github/codeql-action.git
synced 2026-01-01 04:00:24 +08:00
Require message field too
This commit is contained in:
@@ -693,6 +693,13 @@ export class ConfigurationError extends Error {
|
||||
}
|
||||
|
||||
export function asHTTPError(arg: any): HTTPError | undefined {
|
||||
if (
|
||||
typeof arg !== "object" ||
|
||||
arg === null ||
|
||||
typeof arg.message !== "string"
|
||||
) {
|
||||
return undefined;
|
||||
}
|
||||
if (Number.isInteger(arg.status)) {
|
||||
return new HTTPError(arg.message as string, arg.status as number);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user