BPackageManager: Make BCommitTransactionResult available
* BFatalErrorException: Add commitTransactionResult property and respective constructor. In case committing the transaction failed, BPackageManager throws a BFatalErrorException with the result. * BFatalErrorException::UserInteractionHandler: Pass BCommitTransactionResult to ProgressTransactionCommitted().
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -9,6 +9,7 @@
|
||||
#define _PACKAGE__MANAGER__PRIVATE__EXCEPTIONS_H_
|
||||
|
||||
|
||||
#include <package/CommitTransactionResult.h>
|
||||
#include <package/Context.h>
|
||||
|
||||
|
||||
@@ -38,6 +39,8 @@ public:
|
||||
BFatalErrorException(const char* format, ...);
|
||||
BFatalErrorException(status_t error,
|
||||
const char* format, ...);
|
||||
BFatalErrorException(
|
||||
const BCommitTransactionResult& result);
|
||||
|
||||
const BString& Details() const
|
||||
{ return fDetails; }
|
||||
@@ -46,9 +49,16 @@ public:
|
||||
status_t Error() const
|
||||
{ return fError; }
|
||||
|
||||
bool HasCommitTransactionFailed() const
|
||||
{ return fCommitTransactionFailed; }
|
||||
const BCommitTransactionResult& CommitTransactionResult() const
|
||||
{ return fCommitTransactionResult; }
|
||||
|
||||
private:
|
||||
BString fDetails;
|
||||
status_t fError;
|
||||
BCommitTransactionResult fCommitTransactionResult;
|
||||
bool fCommitTransactionFailed;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2013, Haiku, Inc. All Rights Reserved.
|
||||
* Copyright 2013-2014, Haiku, Inc. All Rights Reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
@@ -26,6 +26,10 @@
|
||||
|
||||
namespace BPackageKit {
|
||||
|
||||
|
||||
class BCommitTransactionResult;
|
||||
|
||||
|
||||
namespace BManager {
|
||||
|
||||
namespace BPrivate {
|
||||
@@ -281,7 +285,7 @@ public:
|
||||
InstalledRepository& repository);
|
||||
virtual void ProgressTransactionCommitted(
|
||||
InstalledRepository& repository,
|
||||
const char* transactionDirectoryName);
|
||||
const BCommitTransactionResult& result);
|
||||
virtual void ProgressApplyingChangesDone(
|
||||
InstalledRepository& repository);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user