Added 'DishError' and refined test results.

This commit is contained in:
n1474335 2018-12-25 22:38:53 +00:00
parent d2325306db
commit b29bb6fdd7
7 changed files with 117 additions and 77 deletions

View file

@ -4,10 +4,10 @@
* @license Apache-2.0
*/
// import Operation from "./Operation.js";
import OpModules from "./config/modules/OpModules";
import OperationConfig from "./config/OperationConfig.json";
import OperationError from "./errors/OperationError";
import DishError from "./errors/DishError";
import log from "loglevel";
/**
@ -183,6 +183,10 @@ class Recipe {
// native types is not fully supported yet.
dish.set(err.message, "string");
return i;
} else if (err instanceof DishError ||
(err.type && err.type === "DishError")) {
dish.set(err.message, "string");
return i;
} else {
const e = typeof err == "string" ? { message: err } : err;