Skip to content
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

feat: optimize error message of preheating #3622

Merged
merged 1 commit into from
Oct 30, 2024
Merged

feat: optimize error message of preheating #3622

merged 1 commit into from
Oct 30, 2024

Conversation

gaius-qi
Copy link
Member

Description

This pull request focuses on improving error handling in the manager package by providing more detailed error messages. The most important changes include updating error messages in the Error middleware and enhancing error context in the findSchedulers and findCandidateSchedulers service methods.

Error handling improvements:

  • manager/middlewares/error.go: Updated the error message in the GORM error handler to use err.Error() instead of a generic HTTP status text.

  • manager/service/job.go: Enhanced error context in the findSchedulers method by including the scheduler cluster ID in the error message.

  • manager/service/job.go: Enhanced error context in the findCandidateSchedulers method by including the scheduler cluster ID in the error message.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@gaius-qi gaius-qi added the enhancement New feature or request label Oct 30, 2024
@gaius-qi gaius-qi added this to the v2.2.0 milestone Oct 30, 2024
@gaius-qi gaius-qi self-assigned this Oct 30, 2024
@gaius-qi gaius-qi requested a review from a team as a code owner October 30, 2024 08:00
Copy link
Member

@fcgxz2003 fcgxz2003 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 35.58%. Comparing base (19b38a1) to head (7d8ea38).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
manager/service/job.go 0.00% 4 Missing ⚠️
manager/middlewares/error.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff            @@
##           main    #3622       +/-   ##
=========================================
+ Coverage      0   35.58%   +35.58%     
=========================================
  Files         0      335      +335     
  Lines         0    37389    +37389     
=========================================
+ Hits          0    13305    +13305     
- Misses        0    23241    +23241     
- Partials      0      843      +843     
Flag Coverage Δ
unittests 35.58% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
manager/middlewares/error.go 0.00% <0.00%> (ø)
manager/service/job.go 0.00% <0.00%> (ø)

... and 333 files with indirect coverage changes

Copy link
Member

@chlins chlins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@gaius-qi gaius-qi merged commit ab11fbf into main Oct 30, 2024
26 of 27 checks passed
@gaius-qi gaius-qi deleted the feature/preheat branch October 30, 2024 08:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants