Bug 1445814 - Only call log.error and Cu.reportError once per error
MozReview-Commit-ID: 8saRXO7emt7
--- a/toolkit/components/normandy/lib/RecipeRunner.jsm
+++ b/toolkit/components/normandy/lib/RecipeRunner.jsm
@@ -254,19 +254,18 @@ var RecipeRunner = {
`Skipping recipe ${recipe.name} because ${recipe.action} failed during pre-execution.`
);
status = Uptake.RECIPE_ACTION_DISABLED;
} else {
try {
log.info(`Executing recipe "${recipe.name}" (action=${recipe.action})`);
await manager.runAsyncCallback("action", recipe);
status = Uptake.RECIPE_SUCCESS;
- } catch (e) {
- log.error(`Could not execute recipe ${recipe.name}:`);
- Cu.reportError(e);
+ } catch (err) {
+ log.error(`Could not execute recipe ${recipe.name}: ${err}`);
status = Uptake.RECIPE_EXECUTION_ERROR;
}
}
Uptake.reportRecipe(recipe.id, status);
}
}
@@ -335,19 +334,17 @@ var RecipeRunner = {
* if an error occurred during evaluation.
*/
async checkFilter(recipe) {
const context = this.getFilterContext(recipe);
try {
const result = await FilterExpressions.eval(recipe.filter_expression, context);
return !!result;
} catch (err) {
- log.error(`Error checking filter for "${recipe.name}"`);
- log.error(`Filter: "${recipe.filter_expression}"`);
- log.error(`Error: "${err}"`);
+ log.error(`Error checking filter for "${recipe.name}". Filter: [${recipe.filter_expression}]. Error: "${err}"`);
return false;
}
},
/**
* Clear all caches of systems used by RecipeRunner, in preparation
* for a clean run.
*/