MoralisWeb3/unity-web3-game-kit

No Information on Why UserObj.SaveAsync() Fails

vrxgaminginc opened this issue · 3 comments

Get a MoralisUser in C#

user.username = "existing username"
user.email = "existing email"
bool result = await user.SaveAsync()

result will be false. but you do not know if the failure is due to username or email or both. in the JS SDK, an error is thrown, the error is not propogated to the C# API where it can be caught.

Do you see anything in your console log?

Did you create the user with:

MoralisUser user = Moralis.Create<MoralisUser>();

If not the user was not initialized to Moralis as it was created outside of Moralis. Please note that there are a set of changes that include an update to this process so that MoralisUser default constructor will initialize the user to Morlais.

That being said, a more descriptive error response would be better than returning 'false'

Updated code to include save and a signIn exceptions that are thrown when the server reports a condition other than success.

stale commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.