Skip to content

Error message styling#641

Open
simonLeary42 wants to merge 12 commits intomainfrom
error-message-styling
Open

Error message styling#641
simonLeary42 wants to merge 12 commits intomainfrom
error-message-styling

Conversation

@simonLeary42
Copy link
Copy Markdown
Member

@simonLeary42 simonLeary42 commented Mar 6, 2026

before:

image

after:

image

before:

<script type='text/javascript'>
alert("Invalid requested action or submitted data. -- invalid HTTP_AUTHORIZATION For assistance, contact a Unity admin at support-email@unitywebportal.test. Error ID: 69aacefd0e2f7.");
</script>
<h1>Invalid requested action or submitted data.</h1>
<p>invalid HTTP_AUTHORIZATION For assistance, contact a Unity admin at support-email@unitywebportal.test. Error ID: 69aacefd0e2f7.</p>

after:

<script type='text/javascript'>
alert("Invalid requested action or submitted data. -- invalid HTTP_AUTHORIZATION -- For assistance, contact a Unity admin at support-email@unitywebportal.test -- Error ID: 69aad22600c71");
</script>
<h1>Invalid requested action or submitted data.</h1>
<p>
invalid HTTP_AUTHORIZATION
<br>
For assistance, contact a Unity admin at support-email@unitywebportal.test
<br>
Error ID: 69aad22600c71
</p>

before:

image

after:

image

before:

image

after:

image

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves how error messages are displayed by preserving line breaks in message bodies and formatting “graceful die” output into multi-line text for readability.

Changes:

  • Add CSS to render newline characters in .message p as visual line breaks (white-space: pre-line).
  • Update UnityHTTPD::gracefulDie() to build error body content as lines and render them with <br> separators / -- separators for alerts.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
webroot/css/messages.css Preserves newlines in message bodies to improve readability of multi-line errors.
resources/lib/UnityHTTPD.php Reworks error message construction/rendering to be line-oriented for cleaner display.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread resources/lib/UnityHTTPD.php Outdated
Comment thread resources/lib/UnityHTTPD.php Outdated
Comment thread resources/lib/UnityHTTPD.php Outdated
@simonLeary42
Copy link
Copy Markdown
Member Author

TODO don't add em dashes between every sentence in the body

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants