Skip to content

Add error handling for encrypted oJob file parsing failures#1663

Merged
nmaguiar merged 3 commits intot8from
copilot/sub-pr-1662
Feb 5, 2026
Merged

Add error handling for encrypted oJob file parsing failures#1663
nmaguiar merged 3 commits intot8from
copilot/sub-pr-1662

Conversation

Copy link
Contributor

Copilot AI commented Feb 5, 2026

When dbIP() decryption fails, it returns raw bytes as a string. This fallback was then parsed as YAML/JSON without error handling, producing cryptic parser errors instead of actionable messages about decryption failures.

Changes

  • Wrapped parsing in try-catch blocks for fnReadEncYAML, fnReadEncJSON, fnDownEncYAML, fnDownEncJSON
  • Replaced silent error swallowing in fnDownEncJSON with explicit error messages
  • Added descriptive error messages that indicate the file/URL, suggest decryption key issues, and include underlying parse errors

Example

Before:

// Silent failure or cryptic YAML/JSON parse error
var _r = JSON.parse(content);  // Fails with "Unexpected token" on raw bytes

After:

try {
    _r = JSON.parse(content);
} catch (e) {
    throw "Failed to parse encrypted JSON file 'config.json.enc'. The file may not be properly encrypted or the decryption key may be incorrect. Error: " + e.message;
}

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 5, 2026 12:30
Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
Co-authored-by: nmaguiar <11761746+nmaguiar@users.noreply.github.com>
Copilot AI changed the title [WIP] WIP Address feedback from PR #1662 on changes for T8 Add error handling for encrypted oJob file parsing failures Feb 5, 2026
Copilot AI requested a review from nmaguiar February 5, 2026 12:34
@nmaguiar nmaguiar marked this pull request as ready for review February 5, 2026 12:36
@nmaguiar nmaguiar merged commit 301e30d into t8 Feb 5, 2026
2 checks passed
@nmaguiar nmaguiar deleted the copilot/sub-pr-1662 branch February 5, 2026 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants