K
K
Kirill Petrov2018-11-21 16:11:46
MySQL
Kirill Petrov, 2018-11-21 16:11:46

How to catch/handle database errors in PHP CodeIgnater 3?

CI has a method that returns the request error code, $this->db->error(); but only the last request, and many requests are executed during the application, and if the error was not given by the last one, then the hook where this method was inserted does not register errors... There is an option to embed the handler in the database error output template. But this is a crutch and will not work when called through the CLI ...
I don’t want to refract the code and add logic for processing each request. This is long, and the human error factor in the code is likely.
Tell me how to catch errors in CodeIgnater 3

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dmitriy, 2018-11-21
@dmitriylanets

this is the case when adapter db does not use psr logger interface and does not use S O LID

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question