When adding a new object using add_object(), if set_instance() fails the warning message returned states that the object being added "must be a new object". Through the experience of the user we have found that set_instance() can also fail if the params parameter is malformed though the error message provided will still be the same, causing the user to look for a problem in the wrong place.
We need to do input validation before calling the set_instance() method or as part of the except clause so that the error message provided is meaningful and accurate.
This validation needs to be added to all parts of model_GLM.py to catch a wider variety of causes of failure.
When adding a new object using
add_object()
, ifset_instance()
fails the warning message returned states that the object being added "must be a new object". Through the experience of the user we have found thatset_instance()
can also fail if theparams
parameter is malformed though the error message provided will still be the same, causing the user to look for a problem in the wrong place.We need to do input validation before calling the
set_instance()
method or as part of theexcept
clause so that the error message provided is meaningful and accurate.This validation needs to be added to all parts of model_GLM.py to catch a wider variety of causes of failure.