@@ -202,29 +202,34 @@ auto sourcemeta::jsonschema::lint(const sourcemeta::core::Options &options)
202202
203203 auto copy = entry.second ;
204204
205- const auto wrapper_result = sourcemeta::jsonschema::try_catch ([&]() {
206- try {
207- bundle.apply (
208- copy, sourcemeta::core::schema_official_walker, custom_resolver,
209- get_lint_callback (errors_array, entry, output_json), dialect,
210- sourcemeta::core::URI::from_path (entry.first ).recompose ());
211- return EXIT_SUCCESS;
212- } catch (const sourcemeta::core::SchemaTransformRuleProcessedTwiceError
213- &error) {
214- throw LintAutoFixError{error.what (), entry.first , error.location ()};
215- } catch (const sourcemeta::core::SchemaBrokenReferenceError &error) {
216- throw LintAutoFixError{
217- " Could not autofix the schema without breaking its internal "
218- " references" ,
219- entry.first , error.location ()};
220- } catch (const sourcemeta::core::SchemaUnknownBaseDialectError &) {
221- throw FileError<sourcemeta::core::SchemaUnknownBaseDialectError>(
222- entry.first );
223- } catch (const sourcemeta::core::SchemaResolutionError &error) {
224- throw FileError<sourcemeta::core::SchemaResolutionError>(entry.first ,
225- error);
226- }
227- });
205+ const auto wrapper_result =
206+ sourcemeta::jsonschema::try_catch (options, [&]() {
207+ try {
208+ bundle.apply (
209+ copy, sourcemeta::core::schema_official_walker,
210+ custom_resolver,
211+ get_lint_callback (errors_array, entry, output_json), dialect,
212+ sourcemeta::core::URI::from_path (entry.first ).recompose ());
213+ return EXIT_SUCCESS;
214+ } catch (
215+ const sourcemeta::core::SchemaTransformRuleProcessedTwiceError
216+ &error) {
217+ throw LintAutoFixError{error.what (), entry.first ,
218+ error.location ()};
219+ } catch (
220+ const sourcemeta::core::SchemaBrokenReferenceError &error) {
221+ throw LintAutoFixError{
222+ " Could not autofix the schema without breaking its internal "
223+ " references" ,
224+ entry.first , error.location ()};
225+ } catch (const sourcemeta::core::SchemaUnknownBaseDialectError &) {
226+ throw FileError<sourcemeta::core::SchemaUnknownBaseDialectError>(
227+ entry.first );
228+ } catch (const sourcemeta::core::SchemaResolutionError &error) {
229+ throw FileError<sourcemeta::core::SchemaResolutionError>(
230+ entry.first , error);
231+ }
232+ });
228233
229234 if (wrapper_result == EXIT_SUCCESS) {
230235 if (copy != entry.second ) {
@@ -246,27 +251,28 @@ auto sourcemeta::jsonschema::lint(const sourcemeta::core::Options &options)
246251 resolver (options, options.contains (" http" ), dialect, configuration)};
247252 LOG_VERBOSE (options) << " Linting: " << entry.first .string () << " \n " ;
248253
249- const auto wrapper_result = sourcemeta::jsonschema::try_catch ([&]() {
250- try {
251- const auto subresult = bundle.check (
252- entry.second , sourcemeta::core::schema_official_walker,
253- custom_resolver,
254- get_lint_callback (errors_array, entry, output_json), dialect,
255- sourcemeta::core::URI::from_path (entry.first ).recompose ());
256- scores.emplace_back (subresult.second );
257- if (subresult.first ) {
258- return EXIT_SUCCESS;
259- } else {
260- return EXIT_FAILURE;
261- }
262- } catch (const sourcemeta::core::SchemaUnknownBaseDialectError &) {
263- throw FileError<sourcemeta::core::SchemaUnknownBaseDialectError>(
264- entry.first );
265- } catch (const sourcemeta::core::SchemaResolutionError &error) {
266- throw FileError<sourcemeta::core::SchemaResolutionError>(entry.first ,
267- error);
268- }
269- });
254+ const auto wrapper_result =
255+ sourcemeta::jsonschema::try_catch (options, [&]() {
256+ try {
257+ const auto subresult = bundle.check (
258+ entry.second , sourcemeta::core::schema_official_walker,
259+ custom_resolver,
260+ get_lint_callback (errors_array, entry, output_json), dialect,
261+ sourcemeta::core::URI::from_path (entry.first ).recompose ());
262+ scores.emplace_back (subresult.second );
263+ if (subresult.first ) {
264+ return EXIT_SUCCESS;
265+ } else {
266+ return EXIT_FAILURE;
267+ }
268+ } catch (const sourcemeta::core::SchemaUnknownBaseDialectError &) {
269+ throw FileError<sourcemeta::core::SchemaUnknownBaseDialectError>(
270+ entry.first );
271+ } catch (const sourcemeta::core::SchemaResolutionError &error) {
272+ throw FileError<sourcemeta::core::SchemaResolutionError>(
273+ entry.first , error);
274+ }
275+ });
270276
271277 if (wrapper_result != EXIT_SUCCESS) {
272278 result = false ;
0 commit comments