Skip to content
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

Library should throw errors rather than call fatalError #134

Open
JetForMe opened this issue Aug 14, 2022 · 1 comment
Open

Library should throw errors rather than call fatalError #134

JetForMe opened this issue Aug 14, 2022 · 1 comment

Comments

@JetForMe
Copy link

I'm running into an issue where the library calls fatalError, killing my program rather than throwing an Error for me to handle. By throwing an Error, you allow the client to determine how best to deal with problems. In my case, I can continue with limited functionality even though I can't access GPIOs.

@nallick
Copy link

nallick commented Mar 11, 2024

I concur. I have a small weather station on a RPi2 using a couple GPIO sensors and a couple of I2C devices. It's been running fine for years but suddenly started crashing on launch due to a fault that developed in one of the I2C devices. SwiftyGPIO was calling abort() when it encountered an I2C error. I'd much rather handle this error, log it, and continue servicing the GPIO sensors.

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

2 participants