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

[RPi] Improve exception when not running as root #564

Merged
merged 1 commit into from
Jan 27, 2020

Conversation

CoRfr
Copy link
Contributor

@CoRfr CoRfr commented Jan 26, 2020

It appears that on Raspberry Pi, the code checks
that the process is running as root.

When it's not, it throws a very cryptic error (see #531):
terminate called after throwing an instance of 'int'

I'm not sure that making it compulsory to run as root
is justified, but at least this change improves the
error message.

After it appears as:
terminate called after throwing an instance of 'std::runtime_error'
what(): Process should run as root

utility/RPi/spi.cpp Outdated Show resolved Hide resolved
It appears that on Raspberry Pi, the code checks
that the process is running as root.

When it's not, it throws a very cryptic error (see nRF24#531):
  terminate called after throwing an instance of 'int'

I'm not sure that making it compulsory to run as root
is justified, but at least this change improves the
error message.

After it appears as:
  terminate called after throwing an instance of 'std::runtime_error'
    what():  Process should run as root
@CoRfr CoRfr force-pushed the improve-root-exception branch from 5fb1a4f to 0f02944 Compare January 26, 2020 22:39
@Avamander Avamander merged commit ebbdbf3 into nRF24:master Jan 27, 2020
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

Successfully merging this pull request may close these issues.

2 participants