Skip to content

Commit af0ef43

Browse files
committed
Log warning instead of error if no formats are defined
Signed-off-by: Ben Sherman <bentshermann@gmail.com>
1 parent d0fdc2f commit af0ef43

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

plugins/nf-prov/src/main/nextflow/prov/ProvObserverFactory.groovy

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ class ProvObserverFactory implements TraceObserverFactory {
3636

3737
@Override
3838
Collection<TraceObserver> create(Session session) {
39-
[ createProvObserver(session.config) ]
39+
final observer = createProvObserver(session.config)
40+
observer ? [ observer ] : []
4041
}
4142

4243
protected TraceObserver createProvObserver(Map config) {
4344
final enabled = config.navigate('prov.enabled', true) as Boolean
4445
if( !enabled )
45-
return
46+
return null
4647

4748
final format = config.navigate('prov.format') as String
4849
final file = config.navigate('prov.file', 'manifest.json') as String
@@ -55,8 +56,10 @@ class ProvObserverFactory implements TraceObserverFactory {
5556

5657
formats = config.navigate('prov.formats', formats) as Map
5758

58-
if( !formats )
59-
throw new AbortOperationException("Config setting `prov.formats` is required to specify provenance output formats")
59+
if( !formats ) {
60+
log.warn "Config setting `prov.formats` is not defined, no provenance reports will be produced"
61+
return null
62+
}
6063

6164
final patterns = config.navigate('prov.patterns', []) as List<String>
6265
new ProvObserver(formats, patterns)

0 commit comments

Comments
 (0)