kodevu 0.1.66 → 0.1.67

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/reviewers.js +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodevu",
3
- "version": "0.1.66",
3
+ "version": "0.1.67",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "description": "Poll SVN revisions or Git commits, send each change diff to a reviewer CLI, and write configurable review reports.",
package/src/reviewers.js CHANGED
@@ -190,9 +190,21 @@ export const REVIEWERS = {
190
190
  debug: config.debug
191
191
  });
192
192
 
193
+ const message = execResult.stdout || execResult.stderr || "";
194
+
195
+ // Treat non-zero exit codes as failures and throw so callers can handle them.
196
+ if (typeof execResult.code === "number" && execResult.code !== 0) {
197
+ const err = new Error(
198
+ `OpenCode exited with code ${execResult.code}: ${execResult.stderr || execResult.stdout || ""}`
199
+ );
200
+ // attach execResult for callers that want more details
201
+ err.execResult = execResult;
202
+ throw err;
203
+ }
204
+
193
205
  return {
194
206
  ...execResult,
195
- message: execResult.stdout || execResult.stderr || ""
207
+ message
196
208
  };
197
209
  } finally {
198
210
  await fs.rm(tempDir, { recursive: true, force: true });