Skip to content

feat: Basic Error Handlers + Tests#36

Merged
AttAditya merged 2 commits into
mainfrom
feat/handlers
May 19, 2026
Merged

feat: Basic Error Handlers + Tests#36
AttAditya merged 2 commits into
mainfrom
feat/handlers

Conversation

@AttAditya

@AttAditya AttAditya commented May 19, 2026

Copy link
Copy Markdown
Owner

LangEx 0.4.2

Release Summary

  • Update Type: Minor
  • Update Version: 0.4.2
  • Breaking Changes: No
  • Backwards Compatibility: NA
  • Target Issue: None

Changelog

  • Change 1
    • Added error_handler decorator in langex/handlers/err_handlers.py
    • Provides generic exception handling with fallback
    • Supports custom exception types and fallback functions
  • Change 2
    • Created catch and safe_call utilities in langex/core/handlers.py
    • Exposes them via __all__ for public use
    • Enables safe function execution and exception suppression
  • Change 3
    • Added unit tests in tests/handlers/test_err_handlers.py
    • Verifies safe_call returns None on error
    • Verifies catch returns specified fallback value

Updated Library Highlights

Error Handling Utilities

from langex.core.handlers import catch, safe_call

@safe_call
def risky_operation():
    # This will not raise
    pass

@catch(Exception, lambda: "fallback")
def potentially_failing():
    raise ValueError("oops")

Future Plans

  • Integrate error handling into other core modules
  • Expand fallback mechanisms to support async functions
  • Add more granular logging options

Notes

  • None

@github-actions

Copy link
Copy Markdown

🏷️ Generating labels using AI for commit 3b382ad0c41a6c78a4eecdd3a13df07ed63261e3...

@github-actions

Copy link
Copy Markdown

🔍 Generating PR summary using AI for commit 3b382ad0c41a6c78a4eecdd3a13df07ed63261e3...

@github-actions github-actions Bot added FEAT New feature and functionality TESTS Related to code tests labels May 19, 2026
@github-actions

Copy link
Copy Markdown

✅ PR summary updated using AI for commit 3b382ad0c41a6c78a4eecdd3a13df07ed63261e3.

@github-actions

Copy link
Copy Markdown

🏷️ Labels added: FEAT,TESTS (commit 3b382ad0c41a6c78a4eecdd3a13df07ed63261e3)

@AttAditya AttAditya added MINOR Small updates, non breaking changes RELEASE Version will be bumped labels May 19, 2026
@AttAditya
AttAditya merged commit 4bff430 into main May 19, 2026
1 check passed
@AttAditya
AttAditya deleted the feat/handlers branch May 19, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FEAT New feature and functionality MINOR Small updates, non breaking changes RELEASE Version will be bumped TESTS Related to code tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant