Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/command_lint.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintended changes?

Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ auto sourcemeta::jsonschema::lint(const sourcemeta::core::Options &options)
std::cerr << "\n";
Copy link

@cubic-dev-ai cubic-dev-ai bot Feb 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The PR description states these paths should return exit code 3. However, FileError for CompilerReferenceTargetNotSchemaError, SchemaKeywordError, and SchemaFrameError is caught in src/error.h and explicitly returns EXIT_FAILURE (1), not 3. You must update src/error.h to return 3 for these error types to match the PR goal.

(Based on your team's feedback about reusing centralized error wrappers.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src/command_lint.cc, line 287:

<comment>The PR description states these paths should return exit code 3. However, `FileError` for `CompilerReferenceTargetNotSchemaError`, `SchemaKeywordError`, and `SchemaFrameError` is caught in `src/error.h` and explicitly returns `EXIT_FAILURE` (1), not 3. You must update `src/error.h` to return 3 for these error types to match the PR goal.

(Based on your team's feedback about reusing centralized error wrappers.) </comment>

<file context>
@@ -276,31 +276,37 @@ auto sourcemeta::jsonschema::lint(const sourcemeta::core::Options &options)
               }
 
-              throw Fail{3};
+              throw FileError<sourcemeta::core::SchemaKeywordError>(entry.first,
+                                                                    error);
             } catch (const sourcemeta::core::SchemaFrameError &error) {
</file context>
Fix with Cubic

}

throw FileError<
throw FileError<
sourcemeta::blaze::CompilerReferenceTargetNotSchemaError>(
entry.first, error);
} catch (const sourcemeta::core::SchemaKeywordError &error) {
Expand Down Expand Up @@ -380,7 +380,7 @@ auto sourcemeta::jsonschema::lint(const sourcemeta::core::Options &options)
} catch (
const sourcemeta::blaze::CompilerReferenceTargetNotSchemaError
&error) {
throw FileError<
throw FileError<
sourcemeta::blaze::CompilerReferenceTargetNotSchemaError>(
entry.first, error);
} catch (const sourcemeta::core::SchemaKeywordError &error) {
Expand Down
1 change: 1 addition & 0 deletions src/command_validate.cc
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unintended changes?

Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ auto sourcemeta::jsonschema::validate(const sourcemeta::core::Options &options)
throw FileError<sourcemeta::core::SchemaError>(schema_path, error.what());
}


const auto schema_template{[&]() {
try {
return get_schema_template(bundled, custom_resolver, frame, fast_mode,
Expand Down
6 changes: 3 additions & 3 deletions src/error.h
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ inline auto try_catch(const sourcemeta::core::Options &options,
&error) {
const auto is_json{options.contains("json")};
print_exception(is_json, error);
return EXIT_FAILURE;
return 3;
} catch (const FileError<sourcemeta::core::SchemaResolutionError> &error) {
const auto is_json{options.contains("json")};
print_exception(is_json, error);
Expand All @@ -476,7 +476,7 @@ inline auto try_catch(const sourcemeta::core::Options &options,
}
}

return EXIT_FAILURE;
return 3;
} catch (
const FileError<sourcemeta::core::SchemaUnknownBaseDialectError> &error) {
const auto is_json{options.contains("json")};
Expand All @@ -491,7 +491,7 @@ inline auto try_catch(const sourcemeta::core::Options &options,
"`--default-dialect/-d`\n";
}

return EXIT_FAILURE;
return 3;
} catch (const FileError<sourcemeta::core::SchemaKeywordError> &error) {
const auto is_json{options.contains("json")};
print_exception(is_json, error);
Expand Down