2013-08-31 23:18:28 +04:00
|
|
|
/*
|
2014-06-14 21:06:11 +04:00
|
|
|
* Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
|
2013-08-31 23:18:28 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Ingo Weinhold <ingo_weinhold@gmx.de>
|
|
|
|
*/
|
|
|
|
#ifndef _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
|
|
|
|
#define _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
|
|
|
|
|
|
|
|
|
2014-06-14 21:06:11 +04:00
|
|
|
#include <package/CommitTransactionResult.h>
|
2013-08-31 23:18:28 +04:00
|
|
|
#include <package/Context.h>
|
|
|
|
|
|
|
|
|
|
|
|
namespace BPackageKit {
|
|
|
|
|
|
|
|
namespace BManager {
|
|
|
|
|
|
|
|
namespace BPrivate {
|
|
|
|
|
|
|
|
|
|
|
|
class BException {
|
|
|
|
public:
|
|
|
|
BException();
|
|
|
|
BException(const BString& message);
|
|
|
|
|
|
|
|
const BString& Message() const
|
|
|
|
{ return fMessage; }
|
|
|
|
|
|
|
|
protected:
|
|
|
|
BString fMessage;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BFatalErrorException : public BException {
|
|
|
|
public:
|
|
|
|
BFatalErrorException();
|
|
|
|
BFatalErrorException(const char* format, ...);
|
|
|
|
BFatalErrorException(status_t error,
|
|
|
|
const char* format, ...);
|
2014-06-14 21:06:11 +04:00
|
|
|
BFatalErrorException(
|
|
|
|
const BCommitTransactionResult& result);
|
2013-08-31 23:18:28 +04:00
|
|
|
|
|
|
|
const BString& Details() const
|
|
|
|
{ return fDetails; }
|
|
|
|
BFatalErrorException& SetDetails(const BString& details);
|
|
|
|
|
|
|
|
status_t Error() const
|
|
|
|
{ return fError; }
|
|
|
|
|
2014-06-14 21:06:11 +04:00
|
|
|
bool HasCommitTransactionFailed() const
|
|
|
|
{ return fCommitTransactionFailed; }
|
|
|
|
const BCommitTransactionResult& CommitTransactionResult() const
|
|
|
|
{ return fCommitTransactionResult; }
|
|
|
|
|
2013-08-31 23:18:28 +04:00
|
|
|
private:
|
|
|
|
BString fDetails;
|
|
|
|
status_t fError;
|
2014-06-14 21:06:11 +04:00
|
|
|
BCommitTransactionResult fCommitTransactionResult;
|
|
|
|
bool fCommitTransactionFailed;
|
2013-08-31 23:18:28 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BAbortedByUserException : public BException {
|
|
|
|
public:
|
|
|
|
BAbortedByUserException();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class BNothingToDoException : public BException {
|
|
|
|
public:
|
|
|
|
BNothingToDoException();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace BPrivate
|
|
|
|
|
|
|
|
} // namespace BManager
|
|
|
|
|
|
|
|
} // namespace BPackageKit
|
|
|
|
|
|
|
|
|
|
|
|
#endif // _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
|