Example #1
0
 def v2_int_arg_check(self, arg=99):
     if not isinstance(arg, int):
         raise JSONRPCError(1, 'That is not an integer')
     else:
         return 'got an integer'
Example #2
0
 def v2_decrement(self, x, y=1):
     """Like subtract, but decrements by default."""
     if not isinstance(x, int) and not isinstance(y, int):
         raise JSONRPCError(1, 'That is not an integer')
     else:
         return x - y
Example #3
0
 def subtract(self, x, y):
     if not isinstance(x, int) and not isinstance(y, int):
         raise JSONRPCError(1, 'That is not an integer')
     else:
         return x - y