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

Removing secondary exceptions from console #5513

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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: 3 additions & 1 deletion modules/nextflow/src/main/groovy/nextflow/Nextflow.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ class Nextflow {
* @param message An optional error message
*/
static void error( String message = null ) {
throw message ? new WorkflowScriptErrorException(message) : new WorkflowScriptErrorException()
def err = message ? new WorkflowScriptErrorException(message) : new WorkflowScriptErrorException()
log.error("@Unknown", err)
throw err
}

/**
Expand Down
9 changes: 8 additions & 1 deletion modules/nextflow/src/main/groovy/nextflow/Session.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,15 @@ class Session implements ISession {
log.debug(status)
// dump threads status
log.debug(SysHelper.dumpThreads())

// Do not duplicate error notifications if session has been previously cancelled
if (cancelled) {
log.debug("Session aborted, but was previously cancelled")
} else {
notifyError(null)
}

// force termination
notifyError(null)
ansiLogObserver?.forceTermination()
executorFactory?.signalExecutors()
processesBarrier.forceTermination()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class BufferOp {

@Override
boolean onException(DataflowProcessor processor, Throwable e) {
OperatorImpl.log.error("@unknown", e)
OperatorImpl.log.debug("@unknown", e)
session.abort(e)
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class DataflowHelper {
@Override
boolean onException(final DataflowProcessor processor, final Throwable t) {
final e = t instanceof InvocationTargetException ? t.cause : t
OperatorImpl.log.error("@unknown", e)
OperatorImpl.log.debug("@unknown", e)
pditommaso marked this conversation as resolved.
Show resolved Hide resolved
session?.abort(e)
return true;
}
Expand All @@ -116,7 +116,7 @@ class DataflowHelper {

@Override
boolean onException(final DataflowProcessor processor, final Throwable e) {
DataflowHelper.log.error("@unknown", e)
DataflowHelper.log.debug("@unknown", e)
session.abort(e)
return true
}
Expand Down Expand Up @@ -257,7 +257,7 @@ class DataflowHelper {
events.onComplete.call(processor)
}
catch( Exception e ) {
OperatorImpl.log.error("@unknown", e)
OperatorImpl.log.debug("@unknown", e)
session.abort(e)
}
}
Expand All @@ -266,7 +266,7 @@ class DataflowHelper {
boolean onException(final DataflowProcessor processor, final Throwable e) {
error = true
if( !events.onError ) {
log.error("@unknown", e)
log.debug("@unknown", e)
session.abort(e)
}
else {
Expand Down Expand Up @@ -343,7 +343,7 @@ class DataflowHelper {
}

boolean onException(final DataflowProcessor processor, final Throwable e) {
log.error("@unknown", e)
log.debug("@unknown", e)
session.abort(e)
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class IntoOp {

@Override
public boolean onException(final DataflowProcessor processor, final Throwable e) {
log.error("@unknown", e)
log.debug("@unknown", e)
session.abort(e)
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ class OperatorImpl {
}

boolean onException(final DataflowProcessor processor, final Throwable e) {
OperatorImpl.log.error("@unknown", e)
OperatorImpl.log.debug("@unknown", e)
session.abort(e)
return true;
}
Expand Down Expand Up @@ -859,7 +859,7 @@ class OperatorImpl {

@Override
boolean onException(DataflowProcessor processor, Throwable e) {
OperatorImpl.log.error("@unknown", e)
OperatorImpl.log.debug("@unknown", e)
session.abort(e)
return true
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class TakeOp {
}

boolean onException(final DataflowProcessor processor, final Throwable e) {
TakeOp.log.error("@unknown", e)
TakeOp.log.debug("@unknown", e)
(Global.session as Session).abort(e)
return true;
}
Expand Down