Changeset View
Standalone View
core/kernel/utility/logger.php
Context not available. | |||||
protected function _displayFatalError($errno) | protected function _displayFatalError($errno) | ||||
{ | { | ||||
alex: Can't we just call `StoreVar` method off the `Application` itself? | |||||
$errno = $this->_getFatalErrorTitle($errno); | $errno = $this->_getFatalErrorTitle($errno); | ||||
Not Done ReplyThe Redirect method you're calling below is already saving session content, so this line isn't needed. alex: The `Redirect` method you're calling below is already saving session content, so this line… | |||||
$message = $this->_logger->toString($errno); | |||||
$margin = $this->Application->isAdmin ? '8px' : 'auto'; | if ( PHP_SAPI == 'cli' || !$this->Application || $this->Application->isDebugMode() || $this->Application->isAdmin ) { | ||||
Not Done ReplyItem 5 of the plan in the Jira issue clearly says that new error display system only takes effect when Debug Mode is turned off. Looks like you entirely replaced old system and that's incorrect. alex: Item 5 of the plan in the Jira issue clearly says that new error display system only takes… | |||||
alexUnsubmitted Not Done ReplyHere is what needs to be done:
Here is how I was able to the kLogger::catchLastError method:
alex: Here is what needs to be done:
# add `applicationShutdown` property to `kLogger` class, which… | |||||
alexUnsubmitted Not Done ReplyI think we can benefit from using error_fatal.tpl in Admin Console as well, when debug mode is turned off. To make this happen please replace
alex: I think we can benefit from using `error_fatal.tpl` in Admin Console as well, when debug mode… | |||||
echo '<div style="background-color: #FEFFBF; margin: ' . $margin . '; padding: 10px; border: 2px solid red; text-align: center">' . $this->_logger->toString($errno) . '</div>'; | $margin = $this->Application->isAdmin ? '8px' : 'auto'; | ||||
exit; | echo '<div style="background-color: #FEFFBF; margin: ' . $margin . '; padding: 10px; border: 2px solid red; text-align: center">' . $message . '</div>'; | ||||
exit; | |||||
} | |||||
else { | |||||
$this->Application->StoreVar('FatalErrorMessage', $message); | |||||
$this->Application->Redirect($this->Application->ConfigValue('FatalErrorTemplate')); | |||||
Not Done ReplyThis code will be used when it's Front-End and Debug Mode is Turned Off. In all other cases please use original error reporting code. alex: This code will be used when `it's Front-End` and `Debug Mode is Turned Off`. In all other cases… | |||||
alexUnsubmitted Not Done ReplyWhen we're in admin then use error_fatal as error template and don't read it from system setting to allow Front-End having different template without affecting Admin Console where template name is always the same. alex: When we're in admin then use `error_fatal` as error template and don't read it from system… | |||||
} | |||||
Not Done ReplyPlease remove the isDebugMode part (let's use nice template in debug mode too). alex: Please remove the `isDebugMode` part (let's use nice template in debug mode too). | |||||
Not Done ReplyActually don't change that line, because we're only getting to _displayFatalError method in debug mode, when debug report is invisible and this happens during ajax request only in which case I want to see failed ajax request instead of redirect. alex: Actually don't change that line, because we're only getting to `_displayFatalError` method in… | |||||
} | } | ||||
/** | /** | ||||
Not Done ReplyThis concatenation style doesn't look right. Please to do this instead:
alex: This concatenation style doesn't look right. Please to do this instead:
# create… | |||||
Not Done ReplyTry rearranging code like so:
alex: Try rearranging code like so:
# move `StoreVar` statement on top of outer `else`
# do `… | |||||
Not Done ReplyPlease also do this (for debug mode only):
alex: Please also do this (for debug mode only):
# add the `system-log_id` parameter to redirect… | |||||
Not Done ReplyWhen in CLI:
Idea is to have same error display in CLI as PHP builds it, when it encounters unhandled exception: PHP Fatal error: Uncaught exception 'Exception' with message 'IntuitAnywhere login failed' in /path/to/project/modules/custom/units/helpers/quickbooks/QBConnectorHelper.php:91 Stack trace: #0 /path/to/project/core/kernel/utility/factory.php(118): QBConnectorHelper->Init('QBConnectorHelp...', '', Array) #1 /path/to/project/core/kernel/application.php(2492): kFactory->getObject('QBConnectorHelp...', NULL, Array) #2 /path/to/project/modules/custom/units/helpers/quick_books_helper.php(296): kApplication->recallObject('QBConnectorHelp...') #3 /path/to/project/modules/custom/units/organizations/organization_eh.php(1328): IntechnicQuickBooksHelper->synchronizeVendor(Array) #4 /path/to/project/modules/custom/units/organizations/organization_eh.php(201): OrganizationEventHandler->synchronizeSuppliers(1447405965) #5 /path/to/project/core/kernel/event_handler.php(116): OrganizationEventHandler->OnQuickBooksSynchronize(Object(kEvent)) #6 /mn in /path/to/project/modules/custom/units/helpers/quickbooks/QBConnectorHelper.php on line 91 alex: When in CLI:
# don't append HTML/CSS to the error message
# also show stack trace by using… | |||||
Not Done ReplyPlease don't do it, because we have separate discussion about this at http://community.in-portal.org/x/ZAD3. alex: Please don't do it, because we have separate discussion about this at http://community.in… | |||||
Context not available. | |||||
return $res; | return $res; | ||||
} | } | ||||
} | } | ||||
No newline at end of file | |||||
Context not available. |
Can't we just call StoreVar method off the Application itself?