julep icon indicating copy to clipboard operation
julep copied to clipboard

New branch - required changes made in init.py

Open IamArnab999 opened this issue 1 year ago • 0 comments
trafficstars

Refactored error handling and decorators for clarity and redundancy removal:

  • Removed redundant setattr(__wrapped__) calls in decorators where @wraps already handles forwarding attributes.
  • Simplified error handling in create_agent, update_agent, and delete_agent by removing redundant try-except blocks.
  • Enhanced DatabaseError to include more context-specific information, improving debugging and user experience.

[!IMPORTANT] Improved error handling and removed redundancy in decorators in __init__.py and utils.py.

  • Error Handling:
    • Introduced DatabaseError in __init__.py for context-specific error messages.
    • Enhanced error handling in create_agent, update_agent, and delete_agent with handle_database_exception decorator.
  • Decorators:
    • Removed redundant setattr(__wrapped__) in handle_database_exception in __init__.py and rewrap_exceptions in utils.py.
    • Updated rewrap_exceptions in utils.py to provide more descriptive error messages and context.
  • Misc:
    • Updated docstring in utils.py for rewrap_exceptions to clarify functionality.

This description was created by Ellipsis for 8d5464e38b2b099a46eef802e1c048610b451467. It will automatically update as commits are pushed.

IamArnab999 avatar Oct 13 '24 08:10 IamArnab999