refactor(error-handling): tighten 17 bare except Exception sites with typed handling - #161
Merged
usmanimamu17-create merged 2 commits intoJul 30, 2026
Conversation
… typed handling - Add ApexException base class, ApexNotFoundError, ApexTransientError - Make ApexConflictError and ApexValidationError inherit from ApexException - Fix bare except Exception in webhook_tasks.py, sla_tasks.py, jobs.py, outages.py, sla_service.py, lock.py, correlation.py - Each site now uses ApexException subclasses or specific Python types - logger.exception() added for incident context Closes ApexChainx#93
Contributor
|
@peaceshallom37-rgb resolve conflicts please |
Contributor
|
@peaceshallom37-rgb resolve conflicts |
|
@peaceshallom37-rgb Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
| except ApexTransientError: | ||
| raise # let domain errors propagate | ||
| except Exception as exc: | ||
| logger.exception("Error inside advisory lock (nowait) for '%s'", lock_key) |
usmanimamu17-create
approved these changes
Jul 30, 2026
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
ApexExceptionbase class,ApexNotFoundError,ApexTransientErrorto exception hierarchyApexConflictErrorandApexValidationErrorinherit fromApexExceptionexcept Exceptionin 8 files: webhook_tasks.py, sla_tasks.py, jobs.py, outages.py, sla_service.py, lock.py, correlation.pyApexExceptionsubclasses or specific Python types withlogger.exception()for contextType of Change
Related Issue
Closes #93
Files Changed
app/core/exceptions.py— exception hierarchyapp/tasks/webhook_tasks.py,sla_tasks.py— Celery task typed errorsapp/api/v1/endpoints/jobs.py,outages.py— API endpoint typed errorsapp/services/sla_service.py— SLA computation typed errorsapp/core/lock.py— advisory lock typed errorsapp/middleware/correlation.py— correlation middleware typed errorsChecklist