Welcome Guest, Not a member yet? Register   Sign In
JSon error when database is down
#1
Question 

I have this snippet of code

Code:
$empresa = $this->dbAPI->table('api_empresas');
$usuario = $empresa->select("id,{$modo}_usuario as usu,{$modo}_contrasena as pwd,{$modo}_pin as pin," .
'access_token,expires_in,refresh_token,refresh_expires_in,hora')
->getWhere(['activo' => true, 'api_key' => $api_key])->getRow();

it runs well when database server is available.

The problem is that when the database server is offline for whatever reason, the first line does not fail but the second one returns a message related to a JSon conversion problem which I have not found a way to catch.

How does this issue should be properly addressed?
Reply


Messages In This Thread
JSon error when database is down - by ejimenez - 09-19-2019, 01:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB