@shakecodeslikecray/whiterose 1.0.6 → 1.0.7

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.
package/dist/cli/index.js CHANGED
@@ -326,6 +326,20 @@ var ClaudeCodeExecutor = class {
326
326
  reject: false
327
327
  }
328
328
  );
329
+ if (stderr) {
330
+ if (stderr.includes("429") || stderr.includes("rate limit") || stderr.includes("too many requests")) {
331
+ throw new Error("Claude API rate limit reached. Try again later.");
332
+ }
333
+ if (stderr.includes("401") || stderr.includes("unauthorized") || stderr.includes("invalid api key")) {
334
+ throw new Error("Claude API authentication failed. Check your API key.");
335
+ }
336
+ if (stderr.includes("402") || stderr.includes("insufficient") || stderr.includes("billing")) {
337
+ throw new Error("Claude API billing error. Check your account credits.");
338
+ }
339
+ if (stderr.includes("Error:") && !stdout) {
340
+ throw new Error(`Claude Code error: ${stderr.substring(0, 200)}`);
341
+ }
342
+ }
329
343
  return {
330
344
  output: stdout || "",
331
345
  error: stderr || void 0
@@ -370,6 +384,19 @@ var CodexExecutor = class {
370
384
  reject: false
371
385
  }
372
386
  );
387
+ if (stderr) {
388
+ if (stderr.includes("429") || stderr.includes("usage_limit") || stderr.includes("rate limit")) {
389
+ throw new Error("Codex API rate limit reached. Try again later or upgrade your plan.");
390
+ }
391
+ if (stderr.includes("401") || stderr.includes("unauthorized") || stderr.includes("authentication")) {
392
+ throw new Error("Codex API authentication failed. Check your API key.");
393
+ }
394
+ if (stderr.includes("ERROR:") || stderr.includes("error=http")) {
395
+ const errorMatch = stderr.match(/ERROR:\s*(.+?)(?:\n|$)/i) || stderr.match(/error=(.+?)(?:\n|$)/);
396
+ const errorMsg = errorMatch ? errorMatch[1].trim() : stderr.substring(0, 200);
397
+ throw new Error(`Codex API error: ${errorMsg}`);
398
+ }
399
+ }
373
400
  let output = stdout || "";
374
401
  if (existsSync(outputFile)) {
375
402
  try {