Details
-
Type: Improvement
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.3.0-b1
-
Component/s: None
-
Labels:None
Description
Currently, whenever an exception is encountered by the import manager, we output only the exception message. So we end up with unhelpful sql exception like
importContacts: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'client_id' cannot be null on line 196
Line 196 tells us nothing of where in the importer code the error was encountered. Lets update the Import Manager to use monolog to record the full stack trace so we get some more useful debugging info.
<?php use Blesta\Core\Util\Common\Traits\Container; ... abstract class Migrator { // Load traits use Container; /** * @var Monolog\Logger An instance of the logger */ protected $logger; ... public function __construct(Record $local) { ... // Initialize logger $logger = $this->getFromContainer('logger'); $this->logger = $logger; }
And in the importers change from something like this
} catch (Exception $e) {
$errors[] = $action . ': ' . $e->getMessage() . ' on line ' . $e->getLine();
}
To something like this
} catch (Exception $e) { $errors[] = $action . ': ' . $e->getMessage() . ' on line ' . $e->getLine(); $this->logger->error($e->getTraceAsString()); }
Activity
Jonathan Reissmueller
created issue -
Jonathan Reissmueller
made changes -
Field | Original Value | New Value |
---|---|---|
Story Points | 3 |
Jonathan Reissmueller
made changes -
Summary | Import Manage: Log full stack trace on error | Import Manager: Log full stack trace on error |
Jonathan Reissmueller
made changes -
Fix Version/s | 5.3.0-b1 [ 11711 ] | |
Fix Version/s | 5.2.0 [ 11718 ] |
Jonathan Reissmueller
made changes -
Sprint | 5.3.0 Sprint 1 [ 138 ] |
Jonathan Reissmueller
made changes -
Rank | Ranked higher |
Abdy Franco
made changes -
Assignee | Abdy Franco [ abdy ] |
Abdy Franco
made changes -
Status | Open [ 1 ] | In Progress [ 3 ] |
Abdy Franco
made changes -
Remaining Estimate | 0 minutes [ 0 ] | |
Time Spent | 2 hours, 30 minutes [ 9000 ] | |
Worklog Id | 15286 [ 15286 ] |
Abdy Franco
made changes -
Status | In Progress [ 3 ] | In Review [ 5 ] |
Resolution | Fixed [ 1 ] |
Jonathan Reissmueller
made changes -
Status | In Review [ 5 ] | Closed [ 6 ] |