diff options
| author | Christian Kandeler <christian.kandeler@digia.com> | 2013-06-14 10:57:38 +0200 |
|---|---|---|
| committer | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-06-18 10:57:25 +0200 |
| commit | b1d926024ddded2a43cc182c2d97839bb528def4 (patch) | |
| tree | fe9992446242f7aa25fe1e8c2e8875b8da86dbfe /src/lib/buildgraph/artifactcleaner.cpp | |
| parent | 1d5c5e16a582401f5d1af299f95b57936db84593 (diff) | |
| download | qbs-b1d926024ddded2a43cc182c2d97839bb528def4.tar.gz | |
Some minor improvements to the Error class.
- Rename "Error" to "ErrorInfo", to make clear that this class conveys
information about errors, including that there might not actually be
one.
- Rename "ErrorData" to "ErrorItem", to make clear that these are parts
of an aggregate structure.
- Introduce ErrorInfo::hasError() for quick checking of whether an error
occurred.
Change-Id: Icea6ed5240d6d14bd30e9cea189c6babd7004792
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
Diffstat (limited to 'src/lib/buildgraph/artifactcleaner.cpp')
| -rw-r--r-- | src/lib/buildgraph/artifactcleaner.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/buildgraph/artifactcleaner.cpp b/src/lib/buildgraph/artifactcleaner.cpp index 5fc5deace..d1b76ca69 100644 --- a/src/lib/buildgraph/artifactcleaner.cpp +++ b/src/lib/buildgraph/artifactcleaner.cpp @@ -79,7 +79,7 @@ static void removeArtifactFromDisk(Artifact *artifact, bool dryRun, const Logger invalidateArtifactTimestamp(artifact); QString errorMessage; if (!removeFileRecursion(fileInfo, &errorMessage)) - throw Error(errorMessage); + throw ErrorInfo(errorMessage); } class CleanupVisitor : public ArtifactVisitor @@ -113,7 +113,7 @@ private: } try { removeArtifactFromDisk(artifact, m_options.dryRun(), m_logger); - } catch (const Error &error) { + } catch (const ErrorInfo &error) { if (!m_options.keepGoing()) throw; m_logger.printWarning(error); @@ -161,7 +161,7 @@ void ArtifactCleaner::cleanup(const TopLevelProjectPtr &project, m_observer->incrementProgressValue(); if (m_hasError) - throw Error(Tr::tr("Failed to remove some files.")); + throw ErrorInfo(Tr::tr("Failed to remove some files.")); m_observer->setFinished(); } @@ -180,7 +180,7 @@ void ArtifactCleaner::removeEmptyDirectories(const QString &rootDir, const Clean if (subTreeIsEmpty) { printRemovalMessage(rootDir, options.dryRun(), m_logger); if (!QDir::root().rmdir(rootDir)) { - Error error(Tr::tr("Failure to remove empty directory '%1'.").arg(rootDir)); + ErrorInfo error(Tr::tr("Failure to remove empty directory '%1'.").arg(rootDir)); if (!options.keepGoing()) throw error; m_logger.printWarning(error); |
