$error variable not declared

If there is no exception thrown, then the variable $error is never
created, thus when the signup is successful, a PHP error appears.