erpnext-errors-hooks

Enforce error handling patterns for ERPNext hooks.py configurations.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package --skill erpnext-errors-hooks
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erpnext-errors-hooks
Source: https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package/tree/main/skills/source/errors/erpnext-errors-hooks
Command: npx skills add https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package --skill erpnext-errors-hooks

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

ERPNext hooks.py configurations are error-prone and can disrupt form saves, scheduler jobs, and bootstrapping if not guarded properly. This skill providesRobust, deterministic error-handling patterns to guide safe implementation across hooks.

Core Features & Use Cases

  • Isolated error handling for doc_events to prevent cascading failures during save.
  • Safe scheduler patterns with try/except, logging, and explicit commit handling.
  • Permission hooks that never throw and always return safe fallbacks.
  • Safe extend_bootinfo and parent-class overrides with proper error propagation and logging.

Quick Start

Study the provided examples and apply safe error-handling patterns to ERPNext hooks.py implementations.

Frequently Asked Questions about erpnext-errors-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle errors in ERPNext hooks.py without breaking form saves?

ERPNext doc_events hooks require isolated try/except blocks to prevent cascading failures during saves. Implement safe fallbacks and logging within your hooks.py to ensure non-critical tasks do not disrupt the primary save operation.

Why does my ERPNext scheduler_events hook crash the entire job queue?

Scheduler_events hooks crash queues when lacking proper error handling. Apply try/except blocks with explicit commit handling and logging to isolate failures, ensuring one job's exception does not halt subsequent scheduler executions.

Can permission_query_conditions hooks throw exceptions in ERPNext?

Permission_query_conditions and has_permission hooks must never throw exceptions. Always return safe fallbacks within try/except blocks to prevent access control failures and ensure users retain appropriate read permissions.

What is the best way to override bootinfo in ERPNext v14 to v16 safely?

Safe extend_bootinfo overrides require proper error propagation and logging. Wrap parent-class overrides in try/except blocks to ensure bootstrap failures are logged clearly without breaking the ERPNext application startup sequence.

Do I need explicit commit handling in ERPNext scheduler_events hooks?

Yes, scheduler_events hooks need explicit commit handling. Combine try/except blocks with explicit commits and logging to isolate non-critical tasks, ensuring database integrity when scheduled jobs execute across ERPNext v14 through v16.

What are the limitations of unguarded doc_events hooks in ERPNext?

Unguarded doc_events hooks risk cascading failures during document saves. Without try/except isolation, logging, and safe fallbacks, exceptions in custom hooks.py logic can disrupt standard ERPNext operations and corrupt transactional integrity.