mirror of
https://github.com/github/codeql-action.git
synced 2025-12-22 15:20:19 +08:00
Fix compile errors introduced by typescript 4.4.2
4.4.2 introduces a breaking change that the variable in a catch clause is now `unknown` type. So, we need to cast the `e`, `err`, or `error` variables to type `Error`.
This commit is contained in:
@@ -52,7 +52,7 @@ function getTestConfig(tmpDir: string): Config {
|
||||
|
||||
interface LoggedMessage {
|
||||
type: "debug" | "info" | "warning" | "error";
|
||||
message: string;
|
||||
message: string | Error;
|
||||
}
|
||||
|
||||
function getRecordingLogger(messages: LoggedMessage[]): Logger {
|
||||
@@ -65,11 +65,11 @@ function getRecordingLogger(messages: LoggedMessage[]): Logger {
|
||||
messages.push({ type: "info", message });
|
||||
console.info(message);
|
||||
},
|
||||
warning: (message: string) => {
|
||||
warning: (message: string | Error) => {
|
||||
messages.push({ type: "warning", message });
|
||||
console.warn(message);
|
||||
},
|
||||
error: (message: string) => {
|
||||
error: (message: string | Error) => {
|
||||
messages.push({ type: "error", message });
|
||||
console.error(message);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user