When signing up throws an error, check that error.details is an object before guessing fields errors from it. If error.details is a string, just show it instead of error.reason.
This is useful for Accounts.validateNewUser which only allow customization of the details property