summaryrefslogtreecommitdiff
path: root/src/lib/buildgraph/rulesapplicator.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2013-06-14 10:57:38 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2013-06-18 10:57:25 +0200
commitb1d926024ddded2a43cc182c2d97839bb528def4 (patch)
treefe9992446242f7aa25fe1e8c2e8875b8da86dbfe /src/lib/buildgraph/rulesapplicator.cpp
parent1d5c5e16a582401f5d1af299f95b57936db84593 (diff)
downloadqbs-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/rulesapplicator.cpp')
-rw-r--r--src/lib/buildgraph/rulesapplicator.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/buildgraph/rulesapplicator.cpp b/src/lib/buildgraph/rulesapplicator.cpp
index 11405a716..d51da8003 100644
--- a/src/lib/buildgraph/rulesapplicator.cpp
+++ b/src/lib/buildgraph/rulesapplicator.cpp
@@ -174,7 +174,7 @@ void RulesApplicator::doApply(const ArtifactList &inputArtifacts)
scriptValue = engine()->evaluate(binding.code);
if (Q_UNLIKELY(scriptValue.isError())) {
QString msg = QLatin1String("evaluating rule binding '%1': %2");
- throw Error(msg.arg(binding.name.join(QLatin1String(".")), scriptValue.toString()), binding.location);
+ throw ErrorInfo(msg.arg(binding.name.join(QLatin1String(".")), scriptValue.toString()), binding.location);
}
setConfigProperty(artifactModulesCfg, binding.name, scriptValue.toVariant());
}
@@ -186,7 +186,7 @@ void RulesApplicator::doApply(const ArtifactList &inputArtifacts)
m_transformer->setupOutputs(engine(), scope());
m_transformer->createCommands(m_rule->script, evalContext());
if (Q_UNLIKELY(m_transformer->commands.isEmpty()))
- throw Error(QString("There's a rule without commands: %1.").arg(m_rule->toString()), m_rule->script->location);
+ throw ErrorInfo(QString("There's a rule without commands: %1.").arg(m_rule->toString()), m_rule->script->location);
}
void RulesApplicator::setupScriptEngineForArtifact(Artifact *artifact)
@@ -222,7 +222,7 @@ Artifact *RulesApplicator::createOutputArtifact(const RuleArtifactConstPtr &rule
{
QScriptValue scriptValue = engine()->evaluate(ruleArtifact->fileName);
if (Q_UNLIKELY(scriptValue.isError() || engine()->hasUncaughtException()))
- throw Error("Error in Rule.Artifact fileName: " + scriptValue.toString());
+ throw ErrorInfo("Error in Rule.Artifact fileName: " + scriptValue.toString());
QString outputPath = scriptValue.toString();
outputPath.replace("..", "dotdot"); // don't let the output artifact "escape" its build dir
outputPath = resolveOutPath(outputPath);
@@ -256,7 +256,7 @@ Artifact *RulesApplicator::createOutputArtifact(const RuleArtifactConstPtr &rule
.arg(outputArtifact->transformer->rule->script->location.line())
.arg(outputArtifact->transformer->rule->script->location.column())
.arg(th);
- throw Error(e);
+ throw ErrorInfo(e);
}
}
outputArtifact->fileTags += ruleArtifact->fileTags;