Open muesli4 opened 6 years ago
Maybe it is better to just derive from std::runtime_error
. This way you get wgat()
etc. for free.
Maybe it is better to just derive from
std::runtime_error
. This way you getwgat()
etc. for free.
The thing is that the existing code is not really composable in a way that makes refactoring easy. Is C++11 allowed? If so I can make it work with std::runtime_error
(because I require constructor delegation).
I updated the exception classes to inherit from std::runtime_error
. The examples seem to work and the tests pass. I can condense this into one commit.
I rebased my changes on the recent version and it is only one commit now.
I deliberately caused some of the errors:
> mpd-touch-screen-gui
mpd-touch-screen-gui 0.0.1
Found configuration file: /home/moritz/.config/mpd-touch-screen-gui/program.conf
setting not found exception: program.[default_font]
> mpd-touch-screen-gui
mpd-touch-screen-gui 0.0.1
Found configuration file: /home/moritz/.config/mpd-touch-screen-gui/program.conf
setting type exception: program.default_font.path
> mpd-touch-screen-gui
mpd-touch-screen-gui 0.0.1
Found configuration file: /home/moritz/.config/mpd-touch-screen-gui/program.conf
parse exception: in /home/moritz/.config/mpd-touch-screen-gui/program.conf, at line 6: syntax error
> mpd-touch-screen-gui
mpd-touch-screen-gui 0.0.1
Found configuration file: /home/moritz/.config/mpd-touch-screen-gui/program.conf
parse exception: in /home/moritz/.config/mpd-touch-screen-gui/program.conf, at line 6: duplicate setting name
Is there anything I can improve or change such that this will be merged?
It has been a long time but I took I few minutes trying to get this done. So, I guess better late than never. Let me know if you want anything changed (even small details).
Proposed improvement to https://github.com/hyperrealm/libconfig/issues/108. Let me know what you think about it or if that's something you don't want to change.