Skip to content

ErrorLog

Error log entry DocType.

Stores information about system errors for debugging.
Errors are captured by the global exception handler.
Attributes:
title: Short description of the error
error_type: Exception class name (e.g., "ValueError")
error_message: Full error message
traceback: Stack trace for debugging
request_url: URL that triggered the error
user_id: User who triggered the error
request_id: Request ID for correlation
timestamp: When the error occurred
context: Additional context (headers, params, etc.)
Example:
log = ErrorLog(
title="Validation failed",
error_type="ValidationError",
error_message="Field 'email' is invalid",
)

Source: error_log.py

Field Type Required Description Validators
title str Short description of the error maxLen: 255
error_type str Exception class name (e.g., ValueError) -
error_message str Full error message -
traceback None Full stack trace for debugging -
request_url None URL that triggered the error -
user_id None User who triggered the error -
request_id None Request ID for log correlation -
timestamp datetime When the error occurred (UTC) -
context None Additional context: headers, params, etc. -
Role Create Delete Read Write
System Manager
Setting Value
Submittable False
Track Changes True

Controller hooks are implemented in *_controller.py files. Available lifecycle hooks:

  • validate() - Called before save, raise exceptions for validation errors
  • before_insert() - Called before inserting a new document
  • after_insert() - Called after successfully inserting
  • before_save() - Called before saving (insert or update)
  • after_save() - Called after saving
  • before_delete() - Called before deleting
  • after_delete() - Called after deleting