Permalink
Browse files

Wrap URL parsing errors

  • Loading branch information...
biilmann committed Nov 3, 2017
1 parent c7e8bec commit dc92db4072cb3e9751607da0858b8fab2e9d997d
Showing with 3 additions and 2 deletions.
  1. +3 −2 api/hooks.go
View
@@ -11,6 +11,7 @@ import (
"time"
jwt "github.com/dgrijalva/jwt-go"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/netlify/gotrue/conf"
@@ -147,13 +148,13 @@ func triggerHook(event HookEvent, user *models.User, instanceID string, config *
}
hookURL, err := url.Parse(config.Webhook.URL)
if err != nil {
return err
return errors.Wrapf(err, "Failed to parse Webhook URL")
}
if !hookURL.IsAbs() {
siteURL, err := url.Parse(config.SiteURL)
if err != nil {
return err
return errors.Wrapf(err, "Failed to parse Site URL")
}
hookURL.Scheme = siteURL.Scheme
hookURL.Host = siteURL.Host

0 comments on commit dc92db4

Please sign in to comment.