Fix Javascript evaluation for $run and remove the global error handler. by HikariNee · Pull Request #885 · allthingslinux/tux

@HikariNee closed this

Jun 3, 2025

sourcery-ai[bot]

sourcery-ai[bot]

@HikariNee @kzndotsh

… issues with Javascript, Typescript and Pascal.

@HikariNee @kzndotsh

@HikariNee @kzndotsh

Introduce new exceptions for code execution errors, including
MissingCodeError, InvalidCodeFormatError, UnsupportedLanguageError,
and CompilationError. These exceptions provide specific feedback
to users and are integrated into the error handling configuration
to log and optionally send certain errors to Sentry for monitoring.

Enhancing error handling for code execution improves user experience
by providing clear feedback on what went wrong and allows for better
monitoring of issues related to code execution, aiding in debugging
and improving system reliability.
… and documentation

Add comprehensive docstrings to functions and classes for better
understanding and maintainability. Introduce custom exceptions for
specific error scenarios like missing code, invalid format, unsupported
language, and compilation errors. Refactor code to improve readability
and maintainability by using helper functions and constants. Enhance
user feedback with detailed error messages and usage instructions.

These changes improve the robustness and user experience of the code
execution cog by providing clear error messages and documentation,
making it easier for users to understand how to use the feature and for
developers to maintain and extend the code.

@HikariNee @kzndotsh