Skip to content

Commit

Permalink
chore: add debugging / error information to log file as well
Browse files Browse the repository at this point in the history
### What does this PR do?

Adds some simple code that also outputs any errors with the function to
the log file for debugging purposes / being able to help for any
debugging.

### Screenshot / video of UI

<!-- If this PR is changing UI, please include
screenshots or screencasts showing the difference -->

N/A

### What issues does this PR fix or reference?

<!-- Include any related issues from Podman Desktop
repository (or from another issue tracker). -->

Closes containers#678

### How to test this PR?

<!-- Please explain steps to reproduce -->

1. Before pressing build, stop your Podman Machine
2. See that it outputs the connection error into the build log file.

Signed-off-by: Charlie Drage <[email protected]>
  • Loading branch information
cdrage committed Sep 3, 2024
1 parent 21b20e3 commit db1288c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/backend/src/build-disk-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,11 @@ export async function buildDiskImage(build: BootcBuildInfo, history: History, ov
errorMessage = (error as Error).message;
console.error(error);
telemetryData.error = error;

// Append the error to the file as well for debugging purposes, but do not worry if it fails / errors out the build.
await fs.promises.appendFile(logPath, errorMessage).catch((error: unknown) => {
console.debug('Could not write error to bootc build log: ', error);
});
} finally {
// ###########
// # CLEANUP #
Expand Down

0 comments on commit db1288c

Please sign in to comment.