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
Fixes #1846 by displaying a user-friendly error message instead of a stack trace on boot error #2199
base: master
Are you sure you want to change the base?
Conversation
…ead of a stack trace on boot error
@@ -729,9 +729,10 @@ private static void invokeWith(Mapping entries, ConfiguratorOperation function) | |||
unknownKeys.add(key); | |||
} | |||
}); | |||
|
|||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try removing the trailing spaces at L732.
plugin/src/main/java/io/jenkins/plugins/casc/ConfigurationAsCode.java
Outdated
Show resolved
Hide resolved
…de.java Co-authored-by: Kris Stern <krisstern@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #2199 +/- ##
=========================================
Coverage 80.96% 80.97%
Complexity 843 843
=========================================
Files 72 72
Lines 2506 2507 +1
Branches 352 352
=========================================
+ Hits 2029 2030 +1
Misses 365 365
Partials 112 112
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will still show the stacktrace from what I can see.
Sorry for the late response due to my exams. I felt code snippet in this PR provides a more user-friendly error message compared to the current code snippet, as it throws a ConfiguratorException with a message "Invalid Configuration. Please check your configuration and try again." that can be displayed and by logging the message in the sever level the stack trace would not be shown . If my assumption was wrong, please can you give me a clue as to how I can go ahead to work this issue in a better manner. |
It's not the message itself that's the problem its the stacktrace. The Jenkins core boot failure error message should have the option of suppressing the stacktrace, to fix this issue you would likely need to see where that error page is built in Jenkins core and make displaying the stacktrace optional in some way. |
I shall start working on this issue as per your advice. |
Fixes issue(#1846) with configurator exception being thrown for unknown keys. Now logs the unknown keys and throws a more informative exception.
Your checklist for this pull request
🚨 Please review the guidelines for contributing to this repository.