Skip to content

Commit 9262a31

Browse files
ryancbahanclaude
andcommitted
Add errors to TomlFile and Project, surface TOML parse failures in validate --json
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent a46edbc commit 9262a31

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

packages/app/src/cli/commands/app/config/validate.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,12 @@ export default class Validate extends AppLinkedCommand {
6363
})
6464
app = context.app
6565
} catch (err) {
66-
if (err instanceof AbortError && flags.json) {
67-
const message = unstyled(stringifyMessage(err.message)).trim()
66+
// Only catch config validation errors for JSON output. Auth/linking/remote
67+
// failures should propagate normally — they aren't validation results.
68+
// This is a workaround while we consider more granular error types -- today most everything is AbortError.
69+
const message = err instanceof AbortError ? unstyled(stringifyMessage(err.message)).trim() : ''
70+
const isValidationError = message.startsWith('Validation errors in ')
71+
if (isValidationError && flags.json) {
6872
outputResult(JSON.stringify({valid: false, issues: [{message}]}, null, 2))
6973
throw new AbortSilentError()
7074
}

0 commit comments

Comments
 (0)