Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recover panic #13

Open
gongshen opened this issue Oct 21, 2021 · 0 comments
Open

recover panic #13

gongshen opened this issue Oct 21, 2021 · 0 comments

Comments

@gongshen
Copy link

gongshen commented Oct 21, 2021

// handler.executor_handler.go

func (b *BeanHandler) Execute(jobId int32, glueType string, runParam *JobRunParam) (err error) {
	...

	// add recover
	defer func() {
		r := recover()
		if r != nil {
			err = errors.New(fmt.Sprintf("panic:%v", r))
		}
	}()

	err = b.RunFunc(ctx)
	if err != nil {
		logger.Info(ctx, "job run failed! msg:", err.Error())
		return err
	}

	return err
}
inhere added a commit to goft-cloud/go-xxl-job-client that referenced this issue Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant