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

Escape HTML in exception error messages #499

Closed
yruslan opened this issue Oct 17, 2024 · 0 comments
Closed

Escape HTML in exception error messages #499

yruslan opened this issue Oct 17, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@yruslan
Copy link
Collaborator

yruslan commented Oct 17, 2024

Background

Sometimes, raised exceptions contain HTML. This causes visual effects in email notifications:

Screenshot 2024-10-17 at 9 13 53

Such exception error messages need escaping.

Feature

Escape HTML in exception error messages.

Example

As you can see, even wrapping in <pre>...</pre> does not help

<pre>
  Caused by za.co.absa.atum.agent.exception.AtumAgentException$HttpException: <html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>nginx</center>
</body>
</html>

    za.co.absa.atum.agent.dispatcher.HttpDispatcher.handleResponseBody(HttpDispatcher.scala:80)
    za.co.absa.atum.agent.dispatcher.HttpDispatcher.createPartitioning(HttpDispatcher.scala:54)
    za.co.absa.atum.agent.AtumAgent.getOrCreateAtumContext(AtumAgent.scala:76)
    za.co.absa.atum.agent.AtumAgent.getOrCreateAtumContext$(AtumAgent.scala:72)
    za.co.absa.atum.agent.AtumAgent$.getOrCreateAtumContext(AtumAgent.scala:116)
</pre>

Proposed Solution [Optional]

--

@yruslan yruslan added the enhancement New feature or request label Oct 17, 2024
yruslan added a commit that referenced this issue Oct 18, 2024
yruslan added a commit that referenced this issue Oct 18, 2024
Slow:
Average execution time: 0.00144 ms
Standard deviation: 0.059 ms

Fast:
Average execution time: 0.0018 ms
Standard deviation: 0.0014 ms
yruslan added a commit that referenced this issue Oct 18, 2024
Slow:
Average execution time: 0.00126 ms
Standard deviation: 0.047 ms

Fast:
Average execution time: 0.00096 ms
Standard deviation: 0.0013 ms
yruslan added a commit that referenced this issue Oct 18, 2024
yruslan added a commit that referenced this issue Oct 18, 2024
Slow:
Average execution time: 0.00126 ms
Standard deviation: 0.047 ms

Fast:
Average execution time: 0.00096 ms
Standard deviation: 0.0013 ms
@yruslan yruslan closed this as completed Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant