From bca8cf5f9e0985ffce6fbd38be588c59e8db6f08 Mon Sep 17 00:00:00 2001 From: Juan Cruz Viotti Date: Fri, 4 Jul 2025 10:37:57 -0400 Subject: [PATCH] Improve various schema-related error messages Signed-off-by: Juan Cruz Viotti --- src/core/jsonschema/bundle.cc | 2 +- src/core/jsonschema/jsonschema.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/core/jsonschema/bundle.cc b/src/core/jsonschema/bundle.cc index 9bca4625a..9849b6bbc 100644 --- a/src/core/jsonschema/bundle.cc +++ b/src/core/jsonschema/bundle.cc @@ -107,7 +107,7 @@ auto bundle_schema(sourcemeta::core::JSON &root, } throw sourcemeta::core::SchemaResolutionError( - identifier, "Could not resolve the requested schema"); + identifier, "Could not resolve the reference to an external schema"); } // Otherwise, if the target schema does not declare an inline identifier, diff --git a/src/core/jsonschema/jsonschema.cc b/src/core/jsonschema/jsonschema.cc index 670b37616..e553712b4 100644 --- a/src/core/jsonschema/jsonschema.cc +++ b/src/core/jsonschema/jsonschema.cc @@ -310,7 +310,7 @@ auto sourcemeta::core::base_dialect( resolver(effective_dialect)}; if (!metaschema.has_value()) { throw sourcemeta::core::SchemaResolutionError( - effective_dialect, "Could not resolve the requested schema"); + effective_dialect, "Could not resolve the metaschema of the schema"); } return base_dialect(metaschema.value(), resolver, effective_dialect); @@ -427,7 +427,7 @@ auto sourcemeta::core::vocabularies(const SchemaResolver &resolver, resolver(dialect)}; if (!maybe_schema_dialect.has_value()) { throw sourcemeta::core::SchemaResolutionError( - dialect, "Could not resolve the requested schema"); + dialect, "Could not resolve the metaschema of the schema"); } const sourcemeta::core::JSON &schema_dialect{maybe_schema_dialect.value()}; // At this point we are sure that the dialect is vocabulary aware and the