Skip to content

RuntimeException Not defined #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jerryneedell opened this issue Aug 10, 2017 · 1 comment
Closed

RuntimeException Not defined #1

jerryneedell opened this issue Aug 10, 2017 · 1 comment

Comments

@jerryneedell
Copy link
Contributor

In CircuitPython (2.0.0-beta1.1 but I think it is the same in 1.0.0) RuntimeException is not defined.
The call should just be Exception.
I replaced the 3 occurences of RuntimeException with Exception and it all works fine.
This likely only occurred because I triggered the error condition due to a wiring issue ;-)
It may not have been executed in your testing:

'
#check that the HW id is correct
if self.hw_id != CCS811_HW_ID_CODE:
raise RuntimeException("Device ID returned is not correct! Please check your wiring.")

	#try to start the app
	buf = bytearray(1)
	buf[0] = 0xF4
	self.i2c_device.write(buf, end=1, stop=True)
	time.sleep(.1)
	
	#make sure there are no errors and we have entered application mode
	if self.checkError():
		raise RuntimeException("Device returned an Error! Try removing and reapplying power to the device and running the code again.")
	if not self.fw_mode:
		raise RuntimeException("Device did not enter application mode! If you got here, there may be a problem with the firmware on your sensor.")

`

@jerryneedell
Copy link
Contributor Author

As recommended by @tannewt , the correct call should be RuntimeError - I will update and try a pull request.

kattni pushed a commit that referenced this issue May 14, 2018
Changed ECO2 to eco2 and TVOC to tvoc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant