update error view

This commit is contained in:
Dario Rekowski on RockPI 2019-12-06 14:57:00 +00:00
parent 616e9c4eac
commit f0b8fef4e7

View File

@ -130,7 +130,12 @@ class TransactionCreationsController extends AppController
'transaction_base64' => base64_encode($builderResult['transactionBody']->serializeToString()),
'balance' => $user['balance']
]);
$json = $response->getJson();
//$json = $response->getJson();
try {
$json = $response->getJson();
} catch(Exception $ex) {
$this->Flash->error(__('result isn\'t json ') . $ex->getMessage());
}
if($json['state'] != 'success') {
if($json['msg'] == 'session not found') {
$session->destroy();
@ -297,7 +302,11 @@ class TransactionCreationsController extends AppController
//die($transactionbody);
$response = $http->post($url . '/checkTransaction', $transactionbody, ['type' => 'json']);
//var_dump($response->getStringBody());
$json = $response->getJson();
try {
$json = $response->getJson();
} catch(Exception $ex) {
$this->Flash->error(__('result isn\'t json ') . $ex->getMessage());
}
if($json['state'] != 'success') {
if($json['msg'] == 'session not found') {
$session->destroy();