kumakore / kumakore-sdk

Kumakore SDK
http://www.kumakore.com
3 stars 0 forks source link

Invalid logging in Action onResponse for valid spec returns #50

Open chbfiv opened 10 years ago

chbfiv commented 10 years ago
//ActionMatchGetMoves.cs
                        IDictionary<String, int> attackItems = null;
                        if(matchMap.ContainsKey(ATTACK_ITEMS)) {
                            try {
                                attackItems = (IDictionary<String, int>) matchMap[ATTACK_ITEMS];
                            } catch(InvalidCastException e) {
                                Kumakore.LOGI (TAG,"attackItems is null. " + e.ToString ());
                            }
                        } else LogStatus(StatusCodes.INVALID_KEY,ATTACK_ITEMS+": key not found");

In this example, you should check for null and contains key. instead of wrapping an exception and logging information that might through off the developer. We should also make sure our returned strucutres do NOT contain null fields even though the server is returning null fields per the spec.

This should be reviewed for all actions.

chbfiv commented 10 years ago

@jcyang99 We should also review the spec and make sure we are intentionally returning null values.

chbfiv commented 10 years ago

@blindgoat Added