[TT-12193] Fix poor error handling in webhook event templates#6303
Conversation
|
PR Description updated to latest commit (fe24bf0) |
|
API Changes no api changes detected |
PR Review 🔍
Code feedback:
|
PR Code Suggestions ✨
|
|
|
/release to release-5.3 |
|
Working on it! Note that it can take a few minutes. |
### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]> (cherry picked from commit 11d5798)
|
@titpetric Succesfully merged PR |
… event templates (#6303) [TT-12193] Fix poor error handling in webhook event templates (#6303) ### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]>
### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]>
… event templates (#6303) [TT-12193] Fix poor error handling in webhook event templates (#6303) ### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]>
… event templates (#6303) [TT-12193] Fix poor error handling in webhook event templates (#6303) ### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]>
… event templates (TykTechnologies#6303) [TT-12193] Fix poor error handling in webhook event templates (TykTechnologies#6303) ### **User description** Fixes error handling in webhook handler templates https://tyktech.atlassian.net/browse/TT-12193 ___ ### **PR Type** Bug fix, Tests ___ ### **Description** - Added error handling for template execution in the `CreateBody` method of `WebHookHandler`. - Refactored test helper function to include error handling. - Replaced panic and error checks with `assert.NoError` in tests. - Improved error messages in tests for better clarity. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks.go</strong><dd><code>Add error handling in `CreateBody` method of WebHookHandler</code></dd></summary> <hr> gateway/event_handler_webhooks.go <li>Added error handling for template execution in <code>CreateBody</code> method.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-6587ad3f2629cfa6c84a71144127acd6cc7824e5141f0b4961848945a87e0198">+4/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Tests </strong></td><td><table> <tr> <td> <details> <summary><strong>event_handler_webhooks_test.go</strong><dd><code>Improve error handling and assertions in webhook handler tests</code></dd></summary> <hr> gateway/event_handler_webhooks_test.go <li>Refactored test helper function to include error handling.<br> <li> Replaced panic and error checks with <code>assert.NoError</code>.<br> <li> Improved error messages in tests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6303/files#diff-1a2f8d6ab4443031b0f8486809453f6389291a6f625745fe8c65ac5cdb0e9621">+22/-24</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: >Comment `/help` on the PR to get a list of all available PR-Agent tools and their descriptions Co-authored-by: Tit Petric <[email protected]>


User description
Fixes error handling in webhook handler templates
https://tyktech.atlassian.net/browse/TT-12193
PR Type
Bug fix, Tests
Description
CreateBodymethod ofWebHookHandler.assert.NoErrorin tests.Changes walkthrough 📝
event_handler_webhooks.go
Add error handling in `CreateBody` method of WebHookHandlergateway/event_handler_webhooks.go
CreateBodymethod.event_handler_webhooks_test.go
Improve error handling and assertions in webhook handler testsgateway/event_handler_webhooks_test.go
assert.NoError.