From 584ba2b2d7228d59d16323b37c09eafbe5b94df1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 12:28:27 +0000 Subject: [PATCH 1/3] Initial plan From 26f84158ce7565f5cbb8a57df70f29dcf83afb1a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 12:30:25 +0000 Subject: [PATCH 2/3] Add error handling for encrypted YAML/JSON parsing failures Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com> --- js/owrap.oJob.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/js/owrap.oJob.js b/js/owrap.oJob.js index 4d9fe653..c34bccc0 100755 --- a/js/owrap.oJob.js +++ b/js/owrap.oJob.js @@ -929,7 +929,12 @@ OpenWrap.oJob.prototype.__loadFile = function(aFile, removeTodos, isInclude) { var fnReadEncYAML = f => { var content = io.readFileBytes(f); content = String(Packages.openaf.AFCmdBase.afc.dbIP(content)); - var _r = af.fromYAML(content, true); + var _r; + try { + _r = af.fromYAML(content, true); + } catch (e) { + throw "Failed to parse encrypted YAML file '" + f + "'. The file may not be properly encrypted or the decryption key may be incorrect. Error: " + e.message; + } if (isMap(_r) && __JSONformat.unsafe) { traverse(_r, (aK, aV, aP, aO) => { if (isString(aV) && aV.startsWith("!!js/eval ")) aO[aK] = eval(aV.slice(10)); }); } @@ -938,7 +943,12 @@ OpenWrap.oJob.prototype.__loadFile = function(aFile, removeTodos, isInclude) { var fnReadEncJSON = f => { var content = io.readFileBytes(f); content = String(Packages.openaf.AFCmdBase.afc.dbIP(content)); - var _r = JSON.parse(content); + var _r; + try { + _r = JSON.parse(content); + } catch (e) { + throw "Failed to parse encrypted JSON file '" + f + "'. The file may not be properly encrypted or the decryption key may be incorrect. Error: " + e.message; + } if (isMap(_r) && __JSONformat.unsafe) { traverse(_r, (aK, aV, aP, aO) => { if (isString(aV) && aV.startsWith("!!js/eval ")) aO[aK] = eval(aV.slice(10)); }); } From 1e606923d0c8e2de18904335a1f1af71b376e91d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 5 Feb 2026 12:31:20 +0000 Subject: [PATCH 3/3] Add error handling for encrypted URL downloads Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com> --- js/owrap.oJob.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/js/owrap.oJob.js b/js/owrap.oJob.js index c34bccc0..93d2e01c 100755 --- a/js/owrap.oJob.js +++ b/js/owrap.oJob.js @@ -900,7 +900,11 @@ OpenWrap.oJob.prototype.__loadFile = function(aFile, removeTodos, isInclude) { var _r = $rest({ throwExceptions: true }).getBytes(url); _r = String(Packages.openaf.AFCmdBase.afc.dbIP(_r)); if (isString(_r)) { - _r = af.fromYAML(_r, true); + try { + _r = af.fromYAML(_r, true); + } catch (e) { + throw "Failed to parse encrypted YAML from URL '" + url + "'. The content may not be properly encrypted or the decryption key may be incorrect. Error: " + e.message; + } } if (isMap(_r) && __JSONformat.unsafe) { traverse(_r, (aK, aV, aP, aO) => { if (isString(aV) && aV.startsWith("!!js/eval ")) aO[aK] = eval(aV.slice(10)); }); @@ -918,7 +922,11 @@ OpenWrap.oJob.prototype.__loadFile = function(aFile, removeTodos, isInclude) { var _r = $rest({ throwExceptions: true }).getBytes(url); _r = String(Packages.openaf.AFCmdBase.afc.dbIP(_r)); if (isString(_r)) { - try { _r = JSON.parse(_r); } catch (e) { } + try { + _r = JSON.parse(_r); + } catch (e) { + throw "Failed to parse encrypted JSON from URL '" + url + "'. The content may not be properly encrypted or the decryption key may be incorrect. Error: " + e.message; + } } if (isMap(_r) && __JSONformat.unsafe) { traverse(_r, (aK, aV, aP, aO) => { if (isString(aV) && aV.startsWith("!!js/eval ")) aO[aK] = eval(aV.slice(10)); });