DB warnings

I just spent a day and a half dealing with a cryptic problem in my app. It could have been fixed in minutes if I had been able to see warnings generated in the DB server?

Is there a way to configure yii\db\Connection so that warnings returned by the DB server result in exceptions?

For want of any better ideas I put this in my.cnf


[client-server]

sql_mode = strict_trans_tables

I don’t know for sure if it is any use.

Try


sql-mode = "STRICT_TRANS_TABLES,NO_ZERO_DATE,NO_ZERO_IN_DATE"

It will show everything. I’m using it during development.