fix: do not try to call Error() on nil err#138
Conversation
Signed-off-by: Valery Piashchynski <piashchynski.valery@gmail.com>
WalkthroughThe changes introduce a nil-check in the Changes
Sequence Diagram(s)sequenceDiagram
participant TC as Test Case
participant E1 as err
participant E2 as err2
participant E3 as err3
participant WE as wrapError
participant GOE as GetOriginalErr
%% Flow for non-nil error chain
TC->>E1: Call err()
E1->>E2: Call err2()
E2->>E3: Call err3()
E3-->>E2: Return error ("NoFreeWorkers")
E2-->>E1: Return error ("NoFreeWorkers")
E1-->>TC: Return error ("NoFreeWorkers")
TC->>WE: Call wrapError(error)
WE->>GOE: Pass error to GetOriginalErr
GOE-->>WE: Return error message ("NoFreeWorkers")
WE-->>TC: Return wrapped error
sequenceDiagram
participant TC as Test Case
participant E4 as err4
participant E5 as err5
participant WE as wrapError
participant GOE as GetOriginalErr
%% Flow for nil error chain
TC->>E4: Call err4()
E4->>E5: Call err5()
E5-->>E4: Return nil
E4-->>TC: Return nil
TC->>WE: Call wrapError(nil)
WE->>GOE: Pass nil to GetOriginalErr
GOE-->>WE: Return empty string
WE-->>TC: Return wrapped empty message
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
⏰ Context from checks skipped due to timeout of 90000ms (2)
🔇 Additional comments (5)
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Reason for This PR
closes: roadrunner-server/roadrunner#2125
Description of Changes
License Acceptance
By submitting this pull request, I confirm that my contribution is made under
the terms of the MIT license.
PR Checklist
[Author TODO: Meet these criteria.][Reviewer TODO: Verify that these criteria are met. Request changes if not]git commit -s).CHANGELOG.md.Summary by CodeRabbit
Bug Fixes
Tests