Skip to content

Commit 7cc3d4d

Browse files
authored
Revise various error messages (#1582)
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
1 parent 0b28a37 commit 7cc3d4d

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

src/core/jsonschema/bundle.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ auto definitions_keyword(const std::map<std::string, bool> &vocabularies)
2828
// We don't attempt to bundle on dialects where we
2929
// don't know where to put the embedded schemas
3030
throw sourcemeta::core::SchemaError(
31-
"Cannot determine how to bundle on this dialect");
31+
"Could not determine how to perform bundling in this dialect");
3232
}
3333

3434
auto embed_schema(sourcemeta::core::JSON &definitions,

src/core/jsonschema/frame.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ auto SchemaFrame::analyse(const JSON &schema, const SchemaWalker &walker,
521521
const std::optional<std::string> root_base_dialect{
522522
sourcemeta::core::base_dialect(schema, resolver, default_dialect)};
523523
if (!root_base_dialect.has_value()) {
524-
throw SchemaError("Cannot determine the base dialect of the schema");
524+
throw SchemaError("Could not determine the base dialect of the schema");
525525
}
526526

527527
std::optional<std::string> root_id{sourcemeta::core::identify(

src/core/jsonschema/jsonschema.cc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ auto sourcemeta::core::reidentify(
164164
const auto base_dialect{
165165
sourcemeta::core::base_dialect(schema, resolver, default_dialect)};
166166
if (!base_dialect.has_value()) {
167-
throw sourcemeta::core::SchemaError("Cannot determine base dialect");
167+
throw sourcemeta::core::SchemaError(
168+
"Could not determine the base dialect of the schema");
168169
}
169170

170171
reidentify(schema, new_identifier, base_dialect.value());
@@ -339,7 +340,7 @@ auto sourcemeta::core::vocabularies(
339340
sourcemeta::core::base_dialect(schema, resolver, default_dialect)};
340341
if (!maybe_base_dialect.has_value()) {
341342
throw sourcemeta::core::SchemaError(
342-
"Could not determine base dialect for schema");
343+
"Could not determine base dialect of the schema");
343344
}
344345

345346
const std::optional<std::string> maybe_dialect{
@@ -349,7 +350,7 @@ auto sourcemeta::core::vocabularies(
349350
// provide a explicit default, then we cannot do anything.
350351
// Better to abort instead of trying to guess.
351352
throw sourcemeta::core::SchemaError(
352-
"Cannot determine the dialect of the schema");
353+
"Could not determine the dialect of the schema");
353354
}
354355

355356
return vocabularies(resolver, maybe_base_dialect.value(),

0 commit comments

Comments
 (0)