MDL-33565 setuplib: better error if you pass an object as $debuginfo
MDL-33565 setuplib: better error if you pass an object as $debuginfo

This changes makes sure the error is triggerd when the exception is
thrown, so that the problem code is in the stack-trace. Before, the
error happend in the exception hander, so you could not see the code
that caused the problem.

dilawar/moodle