Skip to content

refactor: cleanup error messages, use consts - #86

Merged
dwickr merged 1 commit into
masterfrom
minor-cleanup
Feb 10, 2026
Merged

dwickr merged 1 commit into
masterfrom
minor-cleanup

Conversation

@dwickr

@dwickr dwickr commented Feb 10, 2026 •

Copy link
Copy Markdown
Contributor
  • Do not send raw exception messages in error handlers
  • Replace var with const for immutable variables
  • Simplify conditional assignments using ternary operators
  • Standardize error responses using res.status().send() pattern
  • Add clarifying comments for message routing logic
  • Simplify 404 handler with template literals

Comment thread web_interface.js Dismissed
.type('txt')
.status(404)
.send('Endpoint ' + req.url + ' not found')
return res.type('txt').status(404).send(`Endpoint ${req.url} not found`)

Check failure

Code scanning / CodeQL

Reflected cross-site scripting High

Cross-site scripting vulnerability due to a
user-provided value
.

@dwickr dwickr Feb 10, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I dismissed this one. This is an API and the content type is text/plain so there's no risk of XSS

Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
Comment thread web_interface.js Fixed
- Do not send raw exception messages in error handlers
- Replace var with const for immutable variables
- Simplify conditional assignments using ternary operators
- Replace array loops with map() for cleaner code
- Standardize error responses using res.status().send() pattern
- Add clarifying comments for message routing logic
- Simplify 404 handler with template literals
@dwickr dwickr changed the title refactor: modernize variable declarations and error handling refactor: cleanup error messages, use consts Feb 10, 2026
Comment thread web_interface.js
Comment thread web_interface.js
Comment thread web_interface.js
Comment thread web_interface.js
@dwickr
dwickr merged commit 9d978b8 into master Feb 10, 2026
6 checks passed
@dwickr
dwickr deleted the minor-cleanup branch February 10, 2026 15:39
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.

3 participants