haiku/headers/private/package/manager/Exceptions.h
Ingo Weinhold 83462cc28d Refactor reusable pkgman code into libpackage
* Move RepositoryBuilder class to libpackage and add B* prefix to name.
* Pull BPackageManager class out of PackageManager and move to
  libpackage. The base class is customizable via three handler objects
  responsible for transaction handling, request execution, respectively
  user interaction.
* Reorganize _ApplyPackageChanges(): Now we first prepare the
  transactions for all affected installation locations (downloading
  files etc.) and then commit them.
2013-08-31 21:19:07 +02:00

75 lines
1.3 KiB
C++

/*
* Copyright 2013, Haiku, Inc. All Rights Reserved.
* 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_
#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, ...);
const BString& Details() const
{ return fDetails; }
BFatalErrorException& SetDetails(const BString& details);
status_t Error() const
{ return fError; }
private:
BString fDetails;
status_t fError;
};
class BAbortedByUserException : public BException {
public:
BAbortedByUserException();
};
class BNothingToDoException : public BException {
public:
BNothingToDoException();
};
} // namespace BPrivate
} // namespace BManager
} // namespace BPackageKit
#endif // _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_