From: Arvin Schnell Date: Wed, 23 Jul 2025 09:08:08 +0000 (+0200) Subject: - store user/group in exception X-Git-Tag: v0.13.0~36^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61da7e16742454e432836d480df644eb06677fb7;p=thirdparty%2Fsnapper.git - store user/group in exception --- diff --git a/snapper/Exception.h b/snapper/Exception.h index d06be7b9..a942e02a 100644 --- a/snapper/Exception.h +++ b/snapper/Exception.h @@ -1,6 +1,6 @@ /* * Copyright (c) [2011-2014] Novell, Inc. - * Copyright (c) [2015-2023] SUSE LLC + * Copyright (c) [2015-2025] SUSE LLC * * All Rights Reserved. * @@ -384,20 +384,25 @@ namespace snapper explicit XAttributesException() : Exception("XAttributes error") {} }; + struct InvalidUserException : public Exception { - explicit InvalidUserException() __attribute__((deprecated)) : Exception("invalid user") {} - explicit InvalidUserException(const std::string& user) : Exception("invalid user '" + user + "'") {} - // TODO save user + explicit InvalidUserException(const std::string& user) + : Exception("invalid user '" + user + "'"), user(user) {} + + const std::string user; }; + struct InvalidGroupException : public Exception { - explicit InvalidGroupException() __attribute__((deprecated)) : Exception("invalid group") {} - explicit InvalidGroupException(const std::string& group) : Exception("invalid group '" + group + "'") {} - // TODO save group + explicit InvalidGroupException(const std::string& group) + : Exception("invalid group '" + group + "'"), group(group) {} + + const std::string group; }; + struct UnsupportedException : public Exception { explicit UnsupportedException() : Exception("unsupported") {}