diff --git a/src/core/Recipe.mjs b/src/core/Recipe.mjs index 0886e994fd..0a2e217da3 100755 --- a/src/core/Recipe.mjs +++ b/src/core/Recipe.mjs @@ -241,9 +241,11 @@ class Recipe { // Cannot rely on `err instanceof OperationError` here as extending // native types is not fully supported yet. dish.set(err.message, "string"); + this.lastRunOp = null; return i; } else if (err instanceof DishError || err?.type === "DishError") { dish.set(err.message, "string"); + this.lastRunOp = null; return i; } else { const e = typeof err == "string" ? { message: err } : err; diff --git a/tests/operations/tests/RenderPDF.mjs b/tests/operations/tests/RenderPDF.mjs index f359aa20c0..ff9c3e5a33 100644 --- a/tests/operations/tests/RenderPDF.mjs +++ b/tests/operations/tests/RenderPDF.mjs @@ -7,6 +7,9 @@ import TestRegister from "../../lib/TestRegister.mjs"; +const oversizedPdfLikeInput = "%PDF-1.0\n" + "A".repeat(5000); + + TestRegister.addTests([ { name: "RenderPDF", @@ -34,4 +37,19 @@ TestRegister.addTests([ } ], }, + { + name: "RenderPDF followed by Generate QR Code error returns plain text", + input: oversizedPdfLikeInput, + expectedOutput: "Error generating QR code. (Error: Too much data)", + recipeConfig: [ + { + "op": "Render PDF", + "args": ["Raw"] + }, + { + "op": "Generate QR Code", + "args": ["PNG", 1, 0, "High"] + } + ], + }, ]);