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