-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: use exception status for logging #21971
Conversation
5886783
to
d01ef03
Compare
Codecov Report
@@ Coverage Diff @@
## master #21971 +/- ##
==========================================
+ Coverage 65.56% 66.99% +1.42%
==========================================
Files 1815 1815
Lines 69553 69623 +70
Branches 7486 7486
==========================================
+ Hits 45604 46642 +1038
+ Misses 22015 21047 -968
Partials 1934 1934
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
dd002fc
to
357dab2
Compare
357dab2
to
ec6025a
Compare
ec6025a
to
baa3c26
Compare
@@ -258,6 +261,17 @@ class ReportScheduleStateNotFoundError(CommandException): | |||
message = _("Report Schedule state not found") | |||
|
|||
|
|||
class ReportScheduleSystemErrorsException(CommandException, SupersetErrorsException): | |||
errors: List[SupersetError] = [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to set an overall status for the array or do we want to do it based upon the most critical error in the error array
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we set the status based upon the most critical
|
||
|
||
class ReportScheduleClientErrorsException(CommandException, SupersetErrorsException): | ||
status = 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we have a status but the exception above doesn't
(cherry picked from commit ce145c6)
SUMMARY
Followup to #21627
In order to be able to log celery errors and warnings separately, I am focusing on report errors for both slack and email and raising either a ReportScheduleClientErrorsException or ReportScheduleSystemErrorsException and then logging according to the status code of each (4xx or 500).
For slack errors, I am also catching each error from the slack api and raising an appropriate http status code, which then helps to inform the logging level for celery.
ADDITIONAL INFORMATION