PySonar icon indicating copy to clipboard operation
PySonar copied to clipboard

Error handling for end of stack

Open kevinahuber opened this issue 7 years ago • 0 comments

Current handling:

InsufficientDataBytes Traceback (most recent call last) /usr/lib/python3.6/site-packages/web3/contract.py in call_contract_function(contract, function_name, transaction, *args, **kwargs) 828 try: --> 829 output_data = decode_abi(output_types, return_data) 830 except DecodingError as e:

/usr/lib/python3.6/site-packages/eth_abi/abi.py in decode_abi(types, data) 108 stream = BytesIO(data) --> 109 return decoder(stream)

/usr/lib/python3.6/site-packages/eth_abi/decoding.py in call(self, stream) 101 def call(self, stream): --> 102 return self.decode(stream) 103

/usr/lib/python3.6/site-packages/eth_utils/functional.py in inner(*args, **kwargs) 32 def inner(*args, **kwargs): ---> 33 return callback(fn(*args, **kwargs)) 34

/usr/lib/python3.6/site-packages/eth_abi/decoding.py in decode(cls, stream) 139 else: --> 140 yield decoder(stream) 141

/usr/lib/python3.6/site-packages/eth_abi/decoding.py in call(self, stream) 101 def call(self, stream): --> 102 return self.decode(stream) 103

/usr/lib/python3.6/site-packages/eth_abi/decoding.py in decode(cls, stream) 164 def decode(cls, stream): --> 165 raw_data = cls.read_data_from_stream(stream) 166 data, padding_bytes = cls.split_data_and_padding(raw_data)

/usr/lib/python3.6/site-packages/eth_abi/decoding.py in read_data_from_stream(cls, stream) 246 cls.data_byte_size, --> 247 len(data), 248 )

InsufficientDataBytes: Tried to read 32 bytes. Only got 0 bytes

The above exception was the direct cause of the following exception:

BadFunctionCallOutput Traceback (most recent call last) in () 5 target_error = 10000 6 ) ----> 7 model_id = repo.submit_model(diabetes_model)

/usr/lib/python3.6/site-packages/sonar-0.1.0-py3.6.egg/sonar/contracts.py in submit_model(self, model) 157 deploy_tx.addModel(IPFSAddress().to_ethereum(ipfs_address), 158 model.initial_error, model.target_error) --> 159 return self.call.getNumModels() - 1 160 161 def submit_gradient(self, from_addr, model_id, grad):

/usr/lib/python3.6/site-packages/web3/contract.py in call_contract_function(contract, function_name, transaction, *args, **kwargs) 849 ) 850 ) --> 851 raise_from(BadFunctionCallOutput(msg), e) 852 853 normalized_data = [

/usr/lib/python3.6/site-packages/web3/utils/exception_py3.py in raise_from(my_exception, other_exception) 1 def raise_from(my_exception, other_exception): ----> 2 raise my_exception from other_exception

BadFunctionCallOutput: Could not decode contract function call getNumModels return data 0x for output_types ['uint256']

https://slack-files.com/T6963A864-F7MTFL2KW-e7a934a640

kevinahuber avatar Oct 21 '17 15:10 kevinahuber