So I've wasted a day because I couldn't figure out how to get an error back from an action I'm using in a plugin...
$newUserSuccess = craft()->users->saveUser($newUser);
$newUserSuccess
was empty, and it turns out the reason was because the new user was trying to register with an existing user's email address, which fails. I could not figure out how to get any useful information back. I had tried this:
if (!$newUserSuccess)
{
AutoUserEntryPlugin::log('Couldn't save the new user: '.print_r($newUser->getErrors(), true), LogLevel::Info);
throw new Exception(Craft::t('Couldnt save the user.'));
}
but in the log all that was output was "Couldn’t save the new user: Array"
How should I be doing this?