Make UEFI boot-platform build again
[haiku.git] / headers / private / package / manager / Exceptions.h
blob0db85dfb7cb3dbb27fb18061bf6b12ab25387ae5
1 /*
2 * Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Ingo Weinhold <ingo_weinhold@gmx.de>
7 */
8 #ifndef _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
9 #define _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
12 #include <package/CommitTransactionResult.h>
13 #include <package/Context.h>
16 namespace BPackageKit {
18 namespace BManager {
20 namespace BPrivate {
23 class BException {
24 public:
25 BException();
26 BException(const BString& message);
28 const BString& Message() const
29 { return fMessage; }
31 protected:
32 BString fMessage;
36 class BFatalErrorException : public BException {
37 public:
38 BFatalErrorException();
39 BFatalErrorException(const char* format, ...);
40 BFatalErrorException(status_t error,
41 const char* format, ...);
42 BFatalErrorException(
43 const BCommitTransactionResult& result);
45 const BString& Details() const
46 { return fDetails; }
47 BFatalErrorException& SetDetails(const BString& details);
49 status_t Error() const
50 { return fError; }
52 bool HasCommitTransactionFailed() const
53 { return fCommitTransactionFailed; }
54 const BCommitTransactionResult& CommitTransactionResult() const
55 { return fCommitTransactionResult; }
57 private:
58 BString fDetails;
59 status_t fError;
60 BCommitTransactionResult fCommitTransactionResult;
61 bool fCommitTransactionFailed;
65 class BAbortedByUserException : public BException {
66 public:
67 BAbortedByUserException();
71 class BNothingToDoException : public BException {
72 public:
73 BNothingToDoException();
77 } // namespace BPrivate
79 } // namespace BManager
81 } // namespace BPackageKit
84 #endif // _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_