How can I debug or show the error trace of errors occur in calling Model->save()
?
At the moment, I'm using logger to debug the execution.
$transaction = App::getModel('mygateway/transaction');
$transaction->setOrderId($order_id);
$transaction->setTransactionId($transaction_id);
Mage::log('saving', null, 'mygateway.log', true);
$transaction->save();
Mage::log('saved', null, 'mygateway.log', true);
Is there something like: $transaction->getLastError()
?
Update (2nd Question)
How to debug $transaction->save()
when it is executed without error, and yet the data is not stored in the database?
try {} catch (Exception $e) {$e->getMessage();}
will get the error message.