Skip to content

Commit

Permalink
Added info to error log if db error on the Device::CreateDevice metho…
Browse files Browse the repository at this point in the history
…d. Need to propagate to the rest of the calls for consistency.

opendcim#164
  • Loading branch information
samilliken committed May 18, 2013
1 parent 37f0787 commit f723aad
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions assets.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,12 @@ function CreateDevice( $db = null ) {
$this->EscalationTimeID, $this->EscalationID, $this->PrimaryContact, $this->Cabinet, $this->Position, $this->Height, $this->Ports,
$this->FirstPortNum, $this->TemplateID, $this->NominalWatts, $this->PowerSupplyCount, $this->DeviceType, $this->ChassisSlots,
$this->RearChassisSlots, $this->ParentDevice, date( "Y-m-d", strtotime( $this->MfgDate )), date( "Y-m-d", strtotime( $this->InstallDate)),
$this->WarrantyCo, date( "Y-m-d", strtotime( $this->WarrantyExpire)), $this->Notes );
$this->WarrantyCo, date( "Y-m-d", strtotime( $this->WarrantyExpire)), $this->Notes, $this->Reservation );

if ( ! $dbh->exec( $sql ) ) {
// Error occurred
printf( "<h3>MySQL Error. SQL = \"%s\"</h3>\n", $sql );
$info = $dbh->errorInfo();

error_log( "PDO Error: " . $info[2] );
return false;
}

Expand Down

0 comments on commit f723aad

Please sign in to comment.