Skip to content

Commit 6f04edd

Browse files
fix(cli): Add null checks for validation_error to fix MyPy type errors
Co-Authored-By: AJ Steers <[email protected]>
1 parent a26b94e commit 6f04edd

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

airbyte_cdk/cli/airbyte_cdk/_manifest.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,19 +95,22 @@ def validate_manifest(manifest_path: Path) -> None:
9595
try:
9696
validate(migrated_manifest, schema)
9797
click.echo(f"❌ Validation failed for {manifest_path}:", err=True)
98-
click.echo(f" {validation_error.message}", err=True)
98+
if validation_error:
99+
click.echo(f" {validation_error.message}", err=True)
99100
click.echo(
100101
"✅ Issues are fixable via migration. Run 'airbyte-cdk manifest migrate' to fix these issues.",
101102
err=True,
102103
)
103104
sys.exit(2) # Fixable issues
104105
except ValidationError:
105106
click.echo(f"❌ Validation failed for {manifest_path}:", err=True)
106-
click.echo(f" {validation_error.message}", err=True)
107+
if validation_error:
108+
click.echo(f" {validation_error.message}", err=True)
107109
sys.exit(3) # Non-fixable issues
108110
else:
109111
click.echo(f"❌ Validation failed for {manifest_path}:", err=True)
110-
click.echo(f" {validation_error.message}", err=True)
112+
if validation_error:
113+
click.echo(f" {validation_error.message}", err=True)
111114
sys.exit(3) # Non-fixable issues
112115

113116
except FileNotFoundError:

0 commit comments

Comments
 (0)