X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcommon%2Ftypes.h;h=72cee266872311758eb0335d7ddf9e6adb389627;hp=d7b44044303f323bc6d60480f678f418561add21;hb=f88bfa81380ceb2c4afce5b15f753570a1ef063d;hpb=b3b83bb123fb3087eba7147539ec0e7a34c6258b diff --git a/src/common/types.h b/src/common/types.h index d7b44044..72cee266 100644 --- a/src/common/types.h +++ b/src/common/types.h @@ -169,3 +169,17 @@ QDataStream &operator>>(QDataStream &in, T &value) { value = static_cast(v); return in; } + +// Exceptions + +/** + * Thrown during initialization to enforce exiting the application before the event loop is started + */ +struct ExitException +{ + int exitCode; + QString errorString; + + ExitException(int code = EXIT_FAILURE, QString error = {}) + : exitCode(code), errorString(std::move(error)) {} +};