Coder Social home page Coder Social logo

Comments (5)

Ronserruya avatar Ronserruya commented on June 16, 2024 1

Thank for reporting, looks like this happens because the android SDK throws an "AccountNotFoundException",
but the Unity bridge only expects "OperationFailedException"

I will update here once we fix it 👍

from kin-sdk-unity.

hitwill avatar hitwill commented on June 16, 2024 1

This was a problem with my code. I had wrapped the above block of code in a function. Naturally, when the wrapper function was called, account.Getbalance would run, but then immediately get thrown out of scope, and be unable log any data.

Resolved by creating a separate callback function, and passing this callback into account.Getbalance.

To illustrate:
Instead of:

function _GetBalance(){
    account.GetBalance( ( ex, balance ) =>
    {
	if( ex == null )
		Debug.Log( "Balance: " + balance );
	else
		Debug.LogError( "Get Balance Failed. " + ex );
    });
}

Simply this:

function _GetBalance(){	
	account.GetBalance(CallbackFunction)
}

from kin-sdk-unity.

Ronserruya avatar Ronserruya commented on June 16, 2024

Actually "AccountNotFoundException" extends "OperationFailedException" so it should have worked.
@prime31 Any idea?

from kin-sdk-unity.

hitwill avatar hitwill commented on June 16, 2024

I'll run some more tests and see if I can get to the bottom of it

from kin-sdk-unity.

prime31 avatar prime31 commented on June 16, 2024

I can't seem to repro this. Steps followed:

  • create KinClient: var client = new KinClient( Environment.Test, "test" );
  • add an account: var account = client.AddAccount();
  • check balance:
account.GetBalance( ( ex, balance ) =>
{
	if( ex == null )
		Debug.Log( "Balance: " + balance );
	else
		Debug.LogError( "Get Balance Failed. " + ex );
});

Results in the completion handler firing with the proper Exception which logged looks like:

03-10 17:05:17.859 22597 22904 E Unity   : Get Balance Failed. Message: Account GBKNHCIICJ7I7U4QUCFGU2JJXRM3RAEW35GPSROKIRC4S5ATMQQOJING was not found, NativeType: AccountNotFoundException, ErrorCode: 0, AccountId: ybbrnaa3m48
03-10 17:05:17.859 22597 22904 E Unity   : UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
03-10 17:05:17.859 22597 22904 E Unity   : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
03-10 17:05:17.859 22597 22904 E Unity   : UnityEngine.Logger:Log(LogType, Object)
03-10 17:05:17.859 22597 22904 E Unity   : UnityEngine.Debug:LogError(Object)
03-10 17:05:17.859 22597 22904 E Unity   : Kin.KinDemoUI:<OnRightColumnGUI>m__3(KinException, Decimal) (at /Users/desaro/Desktop/Kin/Kin Unity/Assets/Kin/Demo/KinDemoUI.cs:221)
03-10 17:05:17.859 22597 22904 E Unity   : Kin.Utils:FireActionInDict(Dictionary`2, String, KinException, Decimal) (at /Users/desaro/Desktop/Kin/Kin Unity/Assets/Kin/Core/DTOs/Utils.cs:104)
03-10 17:05:17.859 22597 22904 E Unity   : Kin.KinManager:GetBalanceFailed(String) (at /Users/desaro/Desktop/Kin/Kin Unity/Assets/Kin/Core/KinManager.cs:145)

from kin-sdk-unity.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.