Erpnext Errors Controllers
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.
Run in terminal (recommended)
claude mcp add erpnext-errors-controllers npx -- -y @trustedskills/erpnext-errors-controllers
Or manually add to ~/.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
validateorbefore_savehooks 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/exceptblocks for comprehensive error management. - Custom Exceptions: Allows raising custom exceptions using
raise. - Specific Error Handling: Supports multiple
exceptclauses to handle different error types. - Cleanup Operations: Enables the use of
finallyblocks 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...exceptblocks within avalidatehook to handle data validation errors.frappe.throw("Invalid value")in abefore_submithook to prevent submission of an invalid document.frappe.log_error("An unexpected error occurred during processing.")within anon_updatehook 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_updateConsiderations: Inon_updatehooks, 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_submithook 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 Hub | Pass |
| Socket | Pass |
| Snyk | Pass |
🌐 Community
Passed automated security scans.