Skip to content

Reduce logging from SEVERE in PipelineNodeTreeScanner corner case #1146

@axel-johansson

Description

@axel-johansson

Hi,

Background:

The following error (line 402) shows up in the Jenkins controller logs as SEVERE (ERROR level in slf4j translate to SEVERE in the java.util.logging).
This stands out a bit in the Jenkins controller logs, since it is "only" a visual impact for the end users, and might not warrant the higher log level.

/*
* This is a corner case for trivial graphs - ones that only have one action. In
* this case the error can be thrown by a the FlowStartNode, which would mean a
* single nodes needs to be a stage and a step. Rather than adding a fake node
* to the graph, we use the end node that we were given to act as the step
* - this might need additional logic when getting the log for the exception.
*/
if (node instanceof BlockEndNode<?> && nodes.size() <= 2) {
if (isDebugEnabled) {
logger.debug("getUnhandledException => Returning node: {}", node.getId());
}
return (BlockEndNode<?>) node;
}
logger.error("Could not find BlockEndNode that threw exception:{}.", errorAction.getDisplayName());
}

Suggestion:

I suggest it might be more suitable to have it as a warn instead. It would then be logged as a WARNING in the Jenkins controller logs, which might be a more appropriate log level.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions