mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
fix(common): support report bug (#18628)
This commit is contained in:
@@ -25,6 +25,7 @@ import (
|
||||
|
||||
"yunion.io/x/log"
|
||||
"yunion.io/x/pkg/errors"
|
||||
"yunion.io/x/pkg/util/version"
|
||||
"yunion.io/x/pkg/utils"
|
||||
|
||||
"yunion.io/x/onecloud/pkg/apihelper"
|
||||
@@ -35,6 +36,7 @@ import (
|
||||
agentssh "yunion.io/x/onecloud/pkg/cloudproxy/agent/ssh"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/auth"
|
||||
cloudproxy_modules "yunion.io/x/onecloud/pkg/mcclient/modules/cloudproxy"
|
||||
"yunion.io/x/onecloud/pkg/mcclient/modules/yunionconf"
|
||||
"yunion.io/x/onecloud/pkg/util/netutils2"
|
||||
ssh_util "yunion.io/x/onecloud/pkg/util/ssh"
|
||||
)
|
||||
@@ -207,6 +209,7 @@ func (w *Worker) Start(ctx context.Context) {
|
||||
func (w *Worker) run(ctx context.Context, mss *agentmodels.ModelSets) (err error) {
|
||||
defer func() {
|
||||
if panicVal := recover(); panicVal != nil {
|
||||
yunionconf.BugReport.SendBugReport(context.Background(), version.GetShortString(), string(debug.Stack()), errors.Errorf("%s", panicVal))
|
||||
if panicErr, ok := panicVal.(runtime.Error); ok {
|
||||
err = errors.Wrap(panicErr, string(debug.Stack()))
|
||||
} else if panicErr, ok := panicVal.(error); ok {
|
||||
|
||||
Reference in New Issue
Block a user