Skip to content

Commit

Permalink
RPC optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
smx-smx committed Jun 1, 2019
1 parent 25bd2a0 commit 4d00cf9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion KodiInterop/KodiInterop/Messages/RpcExitCodes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace Smx.KodiInterop.Messages
public enum RpcExitCodes
{
Success = 0,
ResultNotSerializable = 1
Error = 1,
ResultNotSerializable = 2
}
}
7 changes: 5 additions & 2 deletions csharp/rpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
class RPCError:
SUCCESS = 0
ERROR = 1
'''
eval result is not serializable/representable
this is not an error. it indicates that the result is a complex data type
'''
RESULT_NOT_SERIALIZABLE = 2


Expand Down Expand Up @@ -98,12 +102,11 @@ def on_message(data):
except TypeError as e:
jDict['value'] = None
jDict['exit_code'] = RPCError.RESULT_NOT_SERIALIZABLE
jDict['error'] = repr(e)
jsonData = json.dumps(jDict)
except Exception as e:
jDict['value'] = None
jDict['exit_code'] = RPCError.ERROR
jDict['error'] = repr(e)
finally:
jsonData = json.dumps(jDict)

return jsonData

0 comments on commit 4d00cf9

Please sign in to comment.