Erpnext Errors Hooks

🌐Community
by openaec-foundation · vlatest · Repository

This skill automatically detects and logs ERPNext errors via custom hooks, providing proactive insights for rapid issue resolution and improved system stability.

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-hooks npx -- -y @trustedskills/erpnext-errors-hooks
2

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

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

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

About This Skill

What it does

This skill provides error handling guidance and patterns specifically for ERPNext hooks (hooks.py configurations). It focuses on how to manage errors within different hook types, emphasizing the unique characteristics of each. The skill highlights critical considerations such as transaction behavior, logging requirements, and potential impacts of silent failures, ultimately aiming to improve system stability and enable rapid issue resolution in ERPNext environments.

When to use it

  • When developing custom hooks for ERPNext (e.g., doc_events, scheduler_events).
  • When troubleshooting errors occurring within existing ERPNext hooks.
  • To ensure proper error logging, especially for scheduler hooks where user feedback is unavailable.
  • When implementing permission-related hooks to avoid breaking list views.

Key capabilities

  • Provides guidance on error handling strategies for various hook types (doc_events, scheduler_events, permission_query_conditions, etc.).
  • Explains the unique transaction behavior associated with different event hooks (e.g., validate, on_update).
  • Highlights the importance of logging errors, particularly within scheduler hooks.
  • Details specific error handling requirements for permission-related hooks (has_permission).
  • Covers best practices for extending doctypes and bootinfo.

Example prompts

  • "How should I handle errors in an ERPNext scheduler_events hook?"
  • "What's the correct way to log errors within a doc_events validate hook?"
  • "What are the error handling considerations for permission_query_conditions hooks?"

Tips & gotchas

  • Scheduler hooks require manual database commits (frappe.db.commit()) and rely heavily on frappe.log_error() for debugging as there's no user feedback.
  • Permission hooks should never throw errors; instead, return a safe fallback value (empty string or False).
  • Be aware that multiple handlers can be registered in doc_events, and the first error encountered will halt the chain.

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
29

🌐 Community

Passed automated security scans.