For some reason it seems on MySQLi the mysql error code is not included in the message and mysql also returns 0 as error code. But actually the exception has the correct error code 🤷
0