Skip to content

Use util.inspect to format errors #24

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ReadableStream } from 'stream/web'
import { extractFull } from 'node-7z'
import path from 'path'
import os from 'os'
import util from 'util'

const PlatformMap = {
darwin: 'mac',
Expand Down Expand Up @@ -43,8 +44,8 @@ async function downloadQtC(urls: string[]): Promise<string[]> {
}
return packages.map(packageName => `${tmpDir}/${packageName}`)
} catch (error) {
core.warning((error as Error).message)
errors.push((error as Error).message)
core.warning(util.inspect(error))
errors.push(util.inspect(error))
}
}
throw new Error(
Expand Down Expand Up @@ -118,6 +119,6 @@ export async function run(): Promise<void> {
)
} catch (error) {
// Fail the workflow run if an error occurs
core.setFailed((error as Error).message)
core.setFailed(util.inspect(error))
}
}
Loading