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

[Merged by Bors] - Use AbnormalExit for bad configuration options #124

Closed
wants to merge 1 commit into from

Conversation

graysonguarino
Copy link
Contributor

Fixes #99. I am curious if this PR should include the same change for each std::runtime_error in background_client.cpp. Is mir::AbnormalExit only for issues upon comeup?

@AlanGriffiths
Copy link
Contributor

Is mir::AbnormalExit only for issues upon comeup?

Mostly yes. It about the intended audience of the logged message. When, for example, the configuration doesn't allow Mir to run we want the message to provide help in correcting it (without raising an issue for us to respond to).

These are "expected" exceptions - handling wrong user input.

...
Invalid colour (xxx) given in program argument

(We could improve that text though)

Other exceptions can occur when something goes wrong during execution. For these the intended audience is us, and we want more diagnostic information:

...
ERROR: /build/ubuntu-frame/parts/ubuntu-frame/src/background_client.cpp(180): Throw in function void BackgroundClient::set_colour(const string&, unsigned char (&)[4])
Dynamic exception type: boost::wrapexcept<std::runtime_error>
std::exception::what: Invalid colour (xxx) given in program argument

Copy link
Contributor

@AlanGriffiths AlanGriffiths left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bors merge

bors bot pushed a commit that referenced this pull request Jan 31, 2023
Fixes #99. I am curious if this PR should include the same change for each `std::runtime_error` in `background_client.cpp`. Is `mir::AbnormalExit` only for issues upon comeup?
@bors
Copy link

bors bot commented Jan 31, 2023

Pull request successfully merged into main.

Build succeeded:

@bors bors bot changed the title Use AbnormalExit for bad configuration options [Merged by Bors] - Use AbnormalExit for bad configuration options Jan 31, 2023
@bors bors bot closed this Jan 31, 2023
@bors bors bot deleted the throw_abnormal_exit branch January 31, 2023 10:04
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.

Throw mir::AbnormalExit if bad configuration options given
2 participants