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

[Database] Make object throw warnings and exceptions #1126

Open
M4LuZ opened this issue May 4, 2024 · 0 comments
Open

[Database] Make object throw warnings and exceptions #1126

M4LuZ opened this issue May 4, 2024 · 0 comments

Comments

@M4LuZ
Copy link
Collaborator

M4LuZ commented May 4, 2024

Expected Behavior

As per code documentation (and as per the percieved intention to move towards use of Exceptions and their handling) the database class is supposed to throw Exceptions for certain issues.
But since the related constants are not being set, MySQLi still just uses boolean false return values.
This is problematic, as it provides no good feedback when a prepared statement is not properly formatted (e.g. placeholder in the wrong location as in #1125)

Current Behavior

Exception is thrown on functional issues, but not on MySQLi specific validations / behaviour

Possible Solution

Set at least MYSQLI_REPORT_ERROR, potentially also MYSQLI_REPORT_STRICT if that does not break too much at once.

Steps to Reproduce (for bugs)

Build a wrong prepared statement, notice white screen, see strange error that call to execute() was attempted on a boolean

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

No branches or pull requests

1 participant