Operations 5 min read

Explain Error Plugin Gains Multilingual Output and Return Values for Jenkins Pipelines

The latest update to the Explain Error Plugin adds optional language selection for error explanations and enables the function to return its output, allowing Jenkins pipelines to receive AI‑generated explanations in the desired language and integrate them into automated workflows.

DevOps Engineer
DevOps Engineer
DevOps Engineer
Explain Error Plugin Gains Multilingual Output and Return Values for Jenkins Pipelines

Recent user feedback prompted an immediate enhancement of the Explain Error Plugin, introducing two practical features: multilingual output and return‑value support, making the plugin more flexible for international teams and automation scenarios.

Support for Specified Language Output

Background and Function

Previously the plugin always generated error explanations in English, which was inconvenient for non‑English users. Pull Request #76 added an optional language parameter to the explainError() function, allowing callers to request explanations in Chinese, Japanese, or any other supported language.

How to Use

In a Jenkins Pipeline you can specify the language like this:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'make build' // simulate build process
            }
        }
    }
    post {
        failure {
            // Specify language as Chinese
            explainError(language: '中文')
        }
    }
}

When the build fails, the plugin passes the language argument to the AI and returns the explanation in the chosen language.

Support for Return Value in Pipeline

Background and Function

Some users want to capture the explanation programmatically—for example to send notifications, emails, or push messages to chat tools. Pull Request #77 modified explainError() so that it returns a string result, which can be stored in a variable and used later in the pipeline.

How to Use Return Value

Example pipeline that captures and echoes the explanation:

pipeline {
    agent any
    stages {
        stage('Build') {
            steps {
                sh 'make build'
            }
        }
    }
    post {
        failure {
            script {
                // Get the explanation
                def explanation = explainError(language: '中文')
                echo "AI explanation: ${explanation}"
                // Additional automation can be added here, e.g., send to Slack or email
            }
        }
    }
}

This approach lets you both view the AI‑generated explanation in the Jenkins UI and programmatically process it within your CI/CD workflow.

Key Takeaways

Multilingual support : Use the language parameter to receive explanations in Chinese, Japanese, etc.

Return‑value support : explainError() now returns a string, enabling further automation in pipeline scripts.

These enhancements make the Explain Error Plugin more useful for international teams and automated CI/CD pipelines. For the latest version and to provide feedback, visit the plugin’s GitHub repository.

CI/CDpluginPipelinemultilingualJenkins
DevOps Engineer
Written by

DevOps Engineer

DevOps engineer, Pythonista and FOSS contributor. Created cpp-linter, commit-check, etc.; contributed to PyPA.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.