• Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login
  • Categories
  • Recent
  • Tags
  • Popular
  • Register
  • Login

Post Webhook Handler Error

Scheduled Pinned Locked Moved Troubleshooting
3 Posts 2 Posters 963 Views 1 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    giuseppez
    last edited by 5 Jan 2022, 14:38

    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.

    J 1 Reply Last reply 5 Jan 2022, 20:30 Reply Quote 1
    • J Offline
      jkandasa @giuseppez
      last edited by 5 Jan 2022, 20:30

      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 1 Reply Last reply 7 Jan 2022, 08:09 Reply Quote 0
      • G Offline
        giuseppez @jkandasa
        last edited by 7 Jan 2022, 08:09

        Hi @jkandasa thank you very much.

        1 Reply Last reply Reply Quote 0
        3 out of 3
        • First post
          3/3
          Last post

        0

        Online

        628

        Users

        532

        Topics

        3.4k

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