Address comments from review
- Change error messages. - Use logger instead of core - throw Error instead of write error message
This commit is contained in:
parent
04451e072f
commit
df9b50ee5f
6 changed files with 68 additions and 52 deletions
|
|
@ -909,6 +909,14 @@ export function wrapError(error: unknown): Error {
|
|||
return error instanceof Error ? error : new Error(String(error));
|
||||
}
|
||||
|
||||
export function getErrorMessage(error: unknown): string {
|
||||
return error instanceof Error ? error.toString() : String(error);
|
||||
}
|
||||
|
||||
export async function wait(ms: number) {
|
||||
await new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export function prettyPrintPack(pack: Pack) {
|
||||
return `${pack.name}${pack.version ? `@${pack.version}` : ""}${
|
||||
pack.path ? `:${pack.path}` : ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue