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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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
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.

1 participant