Recently, I received some user feedback, and I immediately enhanced the Explain Error Plugin, adding two very practical features:
- Support for specifying the language of explanation content output
- Support for obtaining AI return values in Pipeline
This update makes the plugin more flexible and user-friendly in multilingual support and automated usage scenarios.
I. Support for Specifying the Language of Explanation Content Output#
Background and Feature#
In previous versions, the error explanation generated by the plugin was in English by default, which was not very user-friendly for non-English speakers.
Through PR #76, I added an optional language parameter to explainError(), allowing users to specify the language in which they want to receive the error explanation.
This means you can have AI explain Jenkins build failure logs in Chinese, Japanese, or other languages, better serving team members from different linguistic backgrounds.
How to Use#
You can use it in a Jenkins Pipeline like this:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make build' // Simulate build process
}
}
}
post {
failure {
// Specify language as Chinese
explainError(language: '中文')
}
}
}With the above configuration, when a build fails, the plugin will pass the language parameter to the AI, which will then generate the error explanation content in the specified language.
II. Support for Return Values for Programmatic Use in Pipeline#
Background and Feature#
In some usage scenarios, users not only want to see the error explanation content in the Jenkins UI but also want to be able to obtain this content within the Pipeline script for further automated processing, such as sending notifications, emails, or pushing to chat tools.
Through PR #77, the plugin added return value support: now the explainError() step can return a string result, making it convenient to save and use within a Pipeline.
How to Use Return Values#
Example Pipeline:
pipeline {
agent any
stages {
stage('Build') {
steps {
sh 'make build'
}
}
}
post {
failure {
script {
// Get the explanation content
def explanation = explainError(language: '中文')
echo "AI Explanation Result: ${explanation}"
// You can do more automated processing here
// e.g., send to Slack or email
}
}
}
}This way, you can not only see the AI-generated explanation content on the Jenkins page but also seamlessly integrate it into your CI/CD workflow.
Summary#
| Feature | Description |
|---|---|
| 🌐 Multilingual Support | Allows AI explanation content to be returned in a specified language (Chinese, Japanese, etc.) via the language: parameter. |
| 🔁 Return Value Support | Explanation content can be returned as a Pipeline step value for automated processing. |
These two new features make Explain Error Plugin even more practical in terms of internationalization and automation, and closer to real-world CI/CD usage scenarios.
Welcome to update to the latest version to experience these new features. If you have any suggestions or feedback, you are also very welcome to raise them on GitHub. Happy CI/CD! 🚀






