public static Session SignUpUser(string email, string handle, string displayName, string password) { try { UsersDataAccess.SignUpUser(email, handle, displayName, password); return(CreateSession(email, handle, displayName, "")); } catch (DuplicateKeyException ex) { if (ex.Message.Contains("PRIMARY")) { throw new EmailAlreadyInUseException(); } else { throw new HandleAlreadyInUseException(); } } }