mirror of
https://github.com/casdoor/casdoor.git
synced 2025-07-04 13:20:19 +08:00
Don't panic for sendWebhook() error.
This commit is contained in:
@ -15,6 +15,7 @@
|
|||||||
package object
|
package object
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/astaxie/beego"
|
"github.com/astaxie/beego"
|
||||||
@ -86,6 +87,8 @@ func AddRecord(record *Record) bool {
|
|||||||
errWebhook := SendWebhooks(record)
|
errWebhook := SendWebhooks(record)
|
||||||
if errWebhook == nil {
|
if errWebhook == nil {
|
||||||
record.IsTriggered = true
|
record.IsTriggered = true
|
||||||
|
} else {
|
||||||
|
fmt.Println(errWebhook)
|
||||||
}
|
}
|
||||||
|
|
||||||
affected, err := adapter.Engine.Insert(record)
|
affected, err := adapter.Engine.Insert(record)
|
||||||
@ -93,10 +96,6 @@ func AddRecord(record *Record) bool {
|
|||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if errWebhook != nil {
|
|
||||||
panic(errWebhook)
|
|
||||||
}
|
|
||||||
|
|
||||||
return affected != 0
|
return affected != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user