• header.categories
    • header.recent
    • header.tags
    • header.popular
    • register
    • login

    Post Webhook Handler Error

    scheduled pinned locked moved Troubleshooting
    3 posts 2 posters 1.1k views 1 watching
    loading-more-posts
    • oldest-to-newest
    • newest-to-oldest
    • most-votes
    reply
    • reply-as-topic
    guest-login-reply
    deleted-message
    • G offline
      giuseppez
      global:last-edited-by,

      Trying to schedule a pair of webhooks, to just understand their functioning, I presume to have encountered an error.
      If you look a the following golang module:
      https://github.com/mycontroller-org/server/blob/master/plugin/handler/webhook/handler.go
      and locate the Post function:

      // Post handler implementation
      func (c *WebhookClient) Post(data map[string]interface{}) error {
      

      you can see that there is a loop on all the configured handler parameters. In my case I configured two:

      webook.PNG

      but only one is executed because, after its inovocation, you can find this code:

      		if err != nil {
      			zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err))
      		}
      		return err
      

      In my opinion the return statement should stay inside the curl brackets in this way:

      		if err != nil {
      			zap.L().Error("error on webhook handler call", zap.Int("responseStatusCode", responseCode), zap.Error(err))
      		        return err
      		}
      
      

      to avoid to return to parent function before finishing the loop.

      jkandasaJ one-reply-to-this-post last-reply-time reply quote 1
      • jkandasaJ offline
        jkandasa @giuseppez
        global:last-edited-by,

        HI @giuseppez thanks to report this issue and root cause of the error.
        I have fixed it as you mentioned. Please try with the recent build

        https://github.com/mycontroller-org/server/commit/ad667fd2ec29ad7bc8b1e558a8b36752f519eecd

        G one-reply-to-this-post last-reply-time reply quote 0
        • G offline
          giuseppez @jkandasa
          global:last-edited-by,

          Hi @jkandasa thank you very much.

          one-reply-to-this-post last-reply-time reply quote 0
          • first-post
            last-post

          0

          online

          644

          users

          532

          topics

          3.4k

          posts
          Copyright © 2015-2025 MyController.org | Contributors | Localization