From 18527a077cde256762d020d0c11f61175a8c9ea2 Mon Sep 17 00:00:00 2001 From: Aaron Petkau Date: Sun, 21 Jan 2024 12:28:48 -0600 Subject: [PATCH] Added additional logging for validation of JSON schema --- .../src/main/nextflow/iridanext/IridaNextJSONOutput.groovy | 3 ++- .../src/main/nextflow/iridanext/IridaNextObserver.groovy | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextJSONOutput.groovy b/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextJSONOutput.groovy index 208b391..d128245 100644 --- a/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextJSONOutput.groovy +++ b/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextJSONOutput.groovy @@ -189,7 +189,8 @@ class IridaNextJSONOutput { outputStream.close() } } catch (ValidationException e) { - log.error "Failed to write IRIDA Next JSON output to ${path}. JSON did not match schema ${jsonSchema}" + log.error "Failed to write IRIDA Next JSON output to ${path}. JSON did not match schema ${jsonSchema.getUri()}. " + + "Message: ${e.getMessage()}" throw e } } diff --git a/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextObserver.groovy b/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextObserver.groovy index 9df4e73..ca3e3ba 100644 --- a/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextObserver.groovy +++ b/plugins/nf-iridanext/src/main/nextflow/iridanext/IridaNextObserver.groovy @@ -139,6 +139,8 @@ class IridaNextObserver implements TraceObserver { SchemaStore schemaStore = new SchemaStore() Path jsonSchemaPathAsPath = Nextflow.file(jsonSchemaPath) as Path jsonSchema = schemaStore.loadSchema(jsonSchemaPathAsPath.toFile().toURI()) + log.debug "Loaded custom schema ${jsonSchema.getUri()} for validating IRIDA Next output " + + "from iridanext.output.schema=${jsonSchemaPath}" } // Used for overriding the "meta.id" key used to define identifiers for a scope