Browse Source

added DBG::log in Response json

Piotr Labudda 9 years ago
parent
commit
001af46891
1 changed files with 6 additions and 0 deletions
  1. 6 0
      SE/se-lib/Response.php

+ 6 - 0
SE/se-lib/Response.php

@@ -1,6 +1,7 @@
 <?php
 
 Lib::loadClass('Request');
+Lib::loadClass('DBG');
 
 /**
  * @example: Response::sendJson($data);
@@ -45,30 +46,35 @@ class Response {
 			$response['type'] = 'error';
 			$response['msg'] = $e->getMessage();
 			$response['code'] = "#" . $e->getCode() . "L" . $e->getLine();
+			DBG::log($e);
 			Response::sendJsonExit($response);
 		} catch (AlertSuccessException $e) {
 			Http::sendHeaderByCode(200);
 			$response['type'] = 'success';
 			$response['msg'] = $e->getMessage();
 			$response['code'] = "#" . $e->getCode() . "L" . $e->getLine();
+			DBG::log($e);
 			Response::sendJsonExit($response);
 		} catch (AlertInfoException $e) {
 			Http::sendHeaderByCode(200);
 			$response['type'] = 'info';
 			$response['msg'] = $e->getMessage();
 			$response['code'] = "#" . $e->getCode() . "L" . $e->getLine();
+			DBG::log($e);
 			Response::sendJsonExit($response);
 		} catch (AlertWarningException $e) {
 			Http::sendHeaderByCode(200);
 			$response['type'] = 'warning';
 			$response['msg'] = $e->getMessage();
 			$response['code'] = "#" . $e->getCode() . "L" . $e->getLine();
+			DBG::log($e);
 			Response::sendJsonExit($response);
 		} catch (Exception $e) {
 			Http::sendHeaderByCode(500);
 			$response['type'] = 'error';
 			$response['msg'] = $e->getMessage();
 			$response['code'] = "#" . $e->getCode() . "L" . $e->getLine();
+			DBG::log($e);
 			Response::sendJsonExit($response);
 		}
 		Http::sendHeaderByCode(200);