Skip to content

Commit da7ec8a

Browse files
Improve error message to tell us what type the object was
1 parent 726b73f commit da7ec8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/ZoneMinder/lib/ZoneMinder/Object.pm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ sub load {
133133
$data = $ZoneMinder::Database::dbh->selectrow_hashref("SELECT * FROM `$table` WHERE `$primary_key`=?", {}, $$self{$primary_key});
134134
if ( !$data ) {
135135
if ( $ZoneMinder::Database::dbh->errstr ) {
136-
Error( "Failure to load Object record for $$self{$primary_key}: Reason: " . $ZoneMinder::Database::dbh->errstr );
136+
Error( "Failure to load Object record for $type id:$$self{$primary_key}: Reason: " . $ZoneMinder::Database::dbh->errstr );
137137
} else {
138138
Debug("No Results Loading $type from $table WHERE $primary_key = $$self{$primary_key}");
139139
} # end if
@@ -173,7 +173,7 @@ sub lock_and_load {
173173
my $data = $ZoneMinder::Database::dbh->selectrow_hashref("SELECT * FROM `$table` WHERE `$primary_key`=? FOR UPDATE", {}, $$self{$primary_key});
174174
if ( ! $data ) {
175175
if ( $ZoneMinder::Database::dbh->errstr ) {
176-
Error("Failure to load Object record for $$self{$primary_key}: Reason: ".$ZoneMinder::Database::dbh->errstr);
176+
Error("Failure to load Object record for $type id:$$self{$primary_key}: Reason: ".$ZoneMinder::Database::dbh->errstr);
177177
} else {
178178
Debug("No Results Lock and Loading $type from $table WHERE $primary_key = $$self{$primary_key}");
179179
} # end if

0 commit comments

Comments
 (0)