Erpnext Errors Controllers

🌐Community
by openaec-foundation · vlatest · Repository

This skill automates error handling in ERPNext by triggering custom actions based on detected issues, streamlining troubleshooting and maintenance.

Install on your platform

We auto-selected Claude Code based on this skill’s supported platforms.

1

Run in terminal (recommended)

terminal
claude mcp add erpnext-errors-controllers npx -- -y @trustedskills/erpnext-errors-controllers
2

Or manually add to ~/.claude/settings.json

~/.claude/settings.json
{
  "mcpServers": {
    "erpnext-errors-controllers": {
      "command": "npx",
      "args": [
        "-y",
        "@trustedskills/erpnext-errors-controllers"
      ]
    }
  }
}

Requires Claude Code (claude CLI). Run claude --version to verify your install.

About This Skill

What it does

This skill provides automated error handling capabilities within ERPNext Document Controllers. It leverages Python's exception handling features (try/except blocks, raise statements) to manage errors that occur during document processing and lifecycle events. The skill allows for custom actions based on detected issues, ultimately streamlining troubleshooting and maintenance of ERPNext documents.

When to use it

This skill is useful in the following scenarios:

  • Implementing robust validation checks within validate or before_save hooks to prevent incorrect data from being saved.
  • Handling potential errors during document updates (on_update) where preventing a save might not be desirable, but logging and error reporting are crucial.
  • Performing critical validations before submission (before_submit) to ensure data integrity.
  • Managing error conditions during the cancellation process (on_cancel).

Key capabilities

  • Full Python Exception Handling: Utilizes try/except blocks for comprehensive error management.
  • Custom Exceptions: Allows raising custom exceptions using raise.
  • Specific Error Handling: Supports multiple except clauses to handle different error types.
  • Cleanup Operations: Enables the use of finally blocks for cleanup tasks regardless of errors.
  • User Error Messages: Uses frappe.throw() to display user-facing error messages and potentially roll back transactions (behavior depends on hook).
  • Silent Error Logging: Provides frappe.log_error() for logging errors without interrupting the process.

Example prompts

This skill doesn't directly respond to natural language prompts. Instead, it is used by developers writing ERPNext controllers who would include code snippets like:

  • try...except blocks within a validate hook to handle data validation errors.
  • frappe.throw("Invalid value") in a before_submit hook to prevent submission of an invalid document.
  • frappe.log_error("An unexpected error occurred during processing.") within an on_update hook to record non-critical issues.

Tips & gotchas

  • Hook Awareness: The behavior of frappe.throw() regarding transaction rollbacks varies significantly depending on the lifecycle hook (validate, before_save, on_update, etc.). Understand these differences carefully.
  • on_update Considerations: In on_update hooks, documents are already saved; frappe.throw() will display an error but not roll back the save. Use logging instead for non-critical errors.
  • Before Submit Validation: Critical validations should ideally be performed in the before_submit hook to prevent submission of invalid data.

Tags

🛡️

TrustedSkills Verification

Unlike other registries that point to live repositories, TrustedSkills pins every skill to a verified commit hash. This protects you from malicious updates — what you install today is exactly what was reviewed and verified.

Security Audits

Gen Agent Trust HubPass
SocketPass
SnykPass

Details

Version
vlatest
License
Author
openaec-foundation
Installs
30

🌐 Community

Passed automated security scans.