Comments (5)
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.
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.
Actually "AccountNotFoundException" extends "OperationFailedException" so it should have worked.
@prime31 Any idea?
from kin-sdk-unity.
I'll run some more tests and see if I can get to the bottom of it
from kin-sdk-unity.
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)
- A few issues, and a request for help. HOT 9
- Compiling with proguard leads to: ClassNotFoundException: kin.unity.KinPlugin HOT 1
- this is a test HOT 1
- Kin Coin intrigate in unity game HOT 2
- PostProcessor.cs missing reference when IOS Module not installed HOT 3
- androidjavaexception java.lang.noclassdeffounderror:failed resoution of:Lkinsdk/kinaccount
- Could not find com.github.kinecosystem.kin-sdk-android:kin-sdk-lib HOT 2
- KinDemoScene - onboarding bad request error, other api calls do not return errors, but just nulls HOT 11
- Where can we see testnet transactions? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kin-sdk-unity.