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

Handling StatusNotFound in IBMMQ scaler #6472

Merged
merged 1 commit into from
Jan 18, 2025
Merged

Conversation

rickbrouwer
Copy link
Contributor

@rickbrouwer rickbrouwer commented Jan 9, 2025

  • Restructured response validation using switch statement for different HTTP status codes
  • Renamed maxDepth to maxDepths for naming consistency with other depth calculation functions
  • Added calculateDepth helper function
  • Improved error handling in IBM MQ scaler:

If you configure something wrong, for example a small typo in the host param, an error will occur like:

error inspecting IBM MQ queue depth: failed to parse response from REST call for queue MY_QUEUE.LQ

You can easily overlook this and not know exactly what the error is.
To solve this I add a http.StatusNotFound that reads the message and presents it. This gives you a clearer message, like:

error inspecting IBM MQ queue depth: MQWB0009E: Could not query the queue manager 'MQMGRR'.

Checklist

@rickbrouwer rickbrouwer requested a review from a team as a code owner January 9, 2025 15:33
@rickbrouwer rickbrouwer force-pushed the ibmmq branch 5 times, most recently from 574ee1c to f1f827b Compare January 9, 2025 17:50
Copy link
Member

@JorTurFer JorTurFer left a comment

Choose a reason for hiding this comment

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

❤️

@JorTurFer
Copy link
Member

JorTurFer commented Jan 17, 2025

/run-e2e ibm
Update: You can check the progress here

@JorTurFer JorTurFer merged commit e667de1 into kedacore:main Jan 18, 2025
19 checks passed
@rickbrouwer rickbrouwer deleted the ibmmq branch January 18, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants