8000 SQL Exceptions not being thrown/caught · Issue #32 · panique/mini3 · GitHub
[go: up one dir, main page]

Skip to content

SQL Exceptions not being thrown/caught #32

Open

Description

@twigz20

screenshot_11

in the above code, the exception is never thrown and allows the program to proceed smoothly.
In the base model, an exception is thrown with a failed DB connection, however, in the extended models, no exception is being thrown with a failed SQL query.

Any idea why?

Activity

  1. mhco commented on Mar 29, 2018

    @mhco

    @panique This isn't an issue with the Mini3 framework, but a general PHP question.

    That being said, try removing the first catch block, as it really doesn't do anything, and why do you have the slash before "Exception"?

  2. Luanr commented on Jul 8, 2022

    @Luanr

    If you really want to throw Exceptions using PDO you can change your Error Mode to Exception Mode instead of warnings on Model.php:

    $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE 44F0 => PDO::ERRMODE_WARNING);

    from PDO::ERRMODE_WARNING to PDO::ERRMODE_EXCEPTION

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0