This commit is contained in:
Roman Kelesidis 2023-11-02 19:37:34 +07:00
parent f4041eeefe
commit 91db4aa0b4
3 changed files with 25 additions and 1 deletions

View File

@ -215,6 +215,7 @@ class ajax_common
{ {
$this->response['error_code'] = $error_code; $this->response['error_code'] = $error_code;
$this->response['error_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $error_msg)); $this->response['error_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $error_msg));
$this->response['console_log'] = 'ajax die: ' . $this->debug_find_source();
$this->send(); $this->send();
} }
@ -334,6 +335,27 @@ class ajax_common
} }
} }
/**
* Find caller source
*/
function debug_find_source ($mode = '')
{
if (!SQL_PREPEND_SRC_COMM) return 'src disabled';
foreach (debug_backtrace() as $trace)
{
if (!empty($trace['file']) && $trace['file'] !== __FILE__)
{
switch ($mode)
{
case 'file': return $trace['file'];
case 'line': return $trace['line'];
default: return hide_bb_path($trace['file']) .'('. $trace['line'] .')';
}
}
}
return 'src not found';
}
function edit_user_profile() function edit_user_profile()
{ {
require(AJAX_DIR . 'edit_user_profile.php'); require(AJAX_DIR . 'edit_user_profile.php');

View File

@ -323,6 +323,7 @@ define('SPHINX_LOG_NAME', 'sphinx_errors'); // имя файла с лог
define('DBG_LOG', true); // включить логирование событий движка (отключите на боевом сервере) define('DBG_LOG', true); // включить логирование событий движка (отключите на боевом сервере)
define('DBG_LOG_TRACKER', false); // включить логирование событий анонсера (отключите на боевом сервере) define('DBG_LOG_TRACKER', false); // включить логирование событий анонсера (отключите на боевом сервере)
define('DEBUG_AJAX_DIE', true); // отображать в консоли браузера файл:строку в которой происходит вызов ajax_die()
define('COOKIE_DBG', 'bb_dbg'); // debug cookie name define('COOKIE_DBG', 'bb_dbg'); // debug cookie name
define('SQL_DEBUG', true); // включить отладку для SQL запросов и Cache & Datastore define('SQL_DEBUG', true); // включить отладку для SQL запросов и Cache & Datastore
define('SQL_BB_LOG_NAME', 'sql_error_bb'); // имя лог файла с SQL ошибками (Форум) define('SQL_BB_LOG_NAME', 'sql_error_bb'); // имя лог файла с SQL ошибками (Форум)

View File

@ -368,6 +368,7 @@ Ajax.prototype = {
} }
else if (response.error_code) { else if (response.error_code) {
ajax.showErrorMsg(response.error_msg); ajax.showErrorMsg(response.error_msg);
console.log(response.console_log);
$('.loading-1').removeClass('loading-1').html('error'); $('.loading-1').removeClass('loading-1').html('error');
} }
else { else {
@ -560,4 +561,4 @@ $(document).ready(function () {
}).mouseout(function () { }).mouseout(function () {
_bMoveble = false; _bMoveble = false;
}); });
}); });