Skip to content

Commit

Permalink
IcingaObject: improve error message
Browse files Browse the repository at this point in the history
Complain about missing object_type, if assign-related properties cannot be
set because of that reason

refs #2142
  • Loading branch information
Thomas-Gelf committed Nov 2, 2022
1 parent 693b8fe commit 63d76ab
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion library/Director/Objects/IcingaObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,14 @@ public function setAssign_filter($filter)
$type = get_class($this);
}

if ($type === null) {
throw new LogicException(
'Cannot set assign_filter unless object_type has been set'
);
}
throw new LogicException(sprintf(
'I can only assign for applied objects or objects with native'
. ' support for assigments, got %s',
. ' support for assignments, got %s',
$type
));
}
Expand Down

0 comments on commit 63d76ab

Please sign in to comment.