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

Nicer error pages #2352

Merged
merged 7 commits into from
Nov 17, 2023
Merged

Nicer error pages #2352

merged 7 commits into from
Nov 17, 2023

Conversation

timja
Copy link
Member

@timja timja commented Aug 28, 2023

Fixes #2351

Before

image

After

image

Your checklist for this pull request

🚨 Please review the guidelines for contributing to this repository.

  • Make sure you are requesting to pull a topic/feature/bugfix branch (right side) and not your master branch!
  • Ensure that the pull request title represents the desired changelog entry
  • Please describe what you did
  • Link to relevant issues in GitHub or in Jenkins JIRA
  • Link to relevant pull requests, esp. upstream and downstream changes
  • Did you provide a test-case? That demonstrates feature works or fixes the issue.

@timja timja force-pushed the nicer-error-pages branch from 12a1fcd to 690edb0 Compare August 28, 2023 20:37
try {
get().configure();
} catch (ConfiguratorException e) {
throw new ConfigurationAsCodeBootFailure(e);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This requires jenkinsci/jenkins#8442 to work properly although it won't do any harm if not present

@timja
Copy link
Member Author

timja commented Aug 28, 2023

@jenkinsci/configuration-as-code-plugin-developers / @jenkinsci/sig-ux any feedback on the error page?

Copy link
Member

@jetersen jetersen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 😅

@timja timja marked this pull request as ready for review November 17, 2023 22:08
@timja timja requested a review from a team as a code owner November 17, 2023 22:08
@timja timja enabled auto-merge (squash) November 17, 2023 22:13
@timja timja merged commit 2d8bab8 into jenkinsci:master Nov 17, 2023
@timja timja deleted the nicer-error-pages branch November 19, 2023 14:24
}
request.setAttribute("invalidAttribute", cause.getInvalidAttribute());
request.setAttribute("validAttributes", cause.getValidAttributes());
request.getView(ConfigurationAsCode.class, "error.jelly").forward(request, response);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I am getting

java.lang.NullPointerException: Cannot invoke "javax.servlet.RequestDispatcher.forward(javax.servlet.ServletRequest, javax.servlet.ServletResponse)" because the return value of "org.kohsuke.stapler.StaplerRequest.getView(java.lang.Class, String)" is null
	at io.jenkins.plugins.casc.ConfigurationAsCode.handleExceptionOnReloading(ConfigurationAsCode.java:207)
	at io.jenkins.plugins.casc.ConfigurationAsCodeBootFailure.doDynamic(ConfigurationAsCodeBootFailure.java:17)

in CloudBees CI after a CasC error during startup. Not sure yet if this is reproducible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nicer error page on configuration error
3 participants