Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix To json errors #260

Merged
merged 2 commits into from
Nov 5, 2024
Merged
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: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
- Improve handling of dynamically-specified URIs
- Rewrite README.md, splitting out developer documentation to README_DEV.md

## [0.8.11] 2024-11-5 UNPUBLISHED

- Catch *all* toJson errors

## [0.8.10] 2024-11-4 UNPUBLISHED

- Ignore publish to 'home'
Expand Down
23 changes: 16 additions & 7 deletions plugins/nf-quilt/src/main/nextflow/quilt/QuiltProduct.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,12 @@ ${nextflow}

String writeNextflowMetadata(Map map, String suffix) {
String filename = "nf-quilt/${suffix}.json"
// log.debug("writeNextflowMetadata[$suffix]: ${filename}")
writeString(QuiltPackage.toJson(map), pkg, filename)
log.debug("writeNextflowMetadata[$suffix]: ${filename}")
try {
writeString(QuiltPackage.toJson(map), pkg, filename)
} catch (Exception e) {
log.error("writeNextflowMetadata.toJson failed: ${e.getMessage()}", map)
}
return filename
}

Expand All @@ -227,7 +231,7 @@ ${nextflow}
writeNextflowMetadata(params, 'params')
params.remove('genomes')
params.remove('test_data')
// printMap(params, 'params')
printMap(params, 'params')
}
Map wf = session.getWorkflowMetadata().toMap()
String start = wf['start']
Expand All @@ -241,7 +245,7 @@ ${nextflow}
wf.remove('complete')
wf.remove('workflowStats')
wf.remove('commandLine')
// printMap(wf, 'workflow')
printMap(wf, 'workflow')
log.info("\npublishing: ${wf['runName']}")
}

Expand All @@ -264,7 +268,7 @@ ${nextflow}
log.error("setupReadme failed: ${e.getMessage()}\n{$e}", pkg.meta)
}
if (text != null && text.length() > 0) {
//log.debug("setupReadme: ${text.length()} bytes")
log.debug("setupReadme: ${text.length()} bytes")
writeString(text, pkg, README_FILE)
}
return text
Expand Down Expand Up @@ -342,8 +346,13 @@ ${nextflow}
}
}

String qs_json = JsonOutput.toJson(quilt_summarize)
writeString(qs_json, pkg, SUMMARY_FILE)
try {
String qs_json = JsonOutput.toJson(quilt_summarize)
writeString(qs_json, pkg, SUMMARY_FILE)
}
catch (Exception e) {
log.error("setupSummarize.toJson failed: ${e.getMessage()}\n{$e}", SUMMARY_FILE)
}
return quilt_summarize
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class QuiltPackage {
List<String> entries = dict.collect { key, value ->
String prefix = JsonOutput.toJson(key)
String suffix = "toJson.error: ${value}"
// log.debug("QuiltPackage.toJson: ${prefix} [${suffix.length()}]")
log.debug("QuiltPackage.toJson: ${prefix} [${suffix.length()}]")
try {
suffix = JsonOutput.toJson(value)
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/nf-quilt/src/resources/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Plugin-Class: nextflow.quilt.QuiltPlugin
Plugin-Id: nf-quilt
Plugin-Version: 0.8.10
Plugin-Version: 0.8.11
Plugin-Provider: Quilt Data
Plugin-Requires: >=22.10.6

Loading