Skip to content

Commit 7a20f77

Browse files
committed
core: improve error handling with console output for debugging
1 parent 731122b commit 7a20f77

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

packages/opencode/script/build.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ for (const [os, arch] of targets) {
4040
await $`tar -xf ../../node_modules/${watcher.replace("@parcel/", "parcel-")}-*.tgz -C ../../node_modules/${watcher} --strip-components=1`
4141

4242
await Bun.build({
43+
sourcemap: true,
4344
compile: {
4445
target: `bun-${os}-${arch}` as any,
4546
outfile: `dist/${name}/bin/opencode`,

packages/opencode/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ try {
129129
Log.Default.error("fatal", data)
130130
const formatted = FormatError(e)
131131
if (formatted) UI.error(formatted)
132-
if (formatted === undefined) UI.error("Unexpected error, check log file at " + Log.file() + " for more details")
132+
if (formatted === undefined) {
133+
UI.error("Unexpected error, check log file at " + Log.file() + " for more details\n")
134+
console.error(e)
135+
}
133136
process.exitCode = 1
134137
}
135138

0 commit comments

Comments
 (0)