add caller info to log when a bad argument is passed to event constructor
This commit is contained in:
parent
bf4bbf8b8d
commit
3baa64aa52
|
@ -14,6 +14,10 @@ class Event {
|
|||
} elseif ( is_array( $IdOrRow ) ) {
|
||||
$row = $IdOrRow;
|
||||
} else {
|
||||
$backTrace = debug_backtrace();
|
||||
$file = $backTrace[1]['file'];
|
||||
$line = $backTrace[1]['line'];
|
||||
Error("Unknown argument passed to Event Constructor from $file:$line)");
|
||||
Error("Unknown argument passed to Event Constructor ($IdOrRow)");
|
||||
return;
|
||||
}
|
||||
|
@ -30,6 +34,9 @@ class Event {
|
|||
public function Storage() {
|
||||
return new Storage( isset($this->{'StorageId'}) ? $this->{'StorageId'} : NULL );
|
||||
}
|
||||
public function Monitor() {
|
||||
return new Monitor( isset($this->{'MonitorId'}) ? $this->{'MonitorId'} : NULL );
|
||||
}
|
||||
public function __call( $fn, array $args){
|
||||
if ( array_key_exists( $fn, $this ) ) {
|
||||
return $this->{$fn};
|
||||
|
|
Loading…
Reference in New Issue