Skip to content

Panic in case of the request has been processed #2081

@aryanmehrotra

Description

@aryanmehrotra

Describe the bug
I created a goroutine which would panic after 10 seconds after request came, and then it would panic.

To Reproduce
Sample Handler code

func HelloHandler(c *gofr.Context) (any, error) {

	go func() {
		time.Sleep(10 * time.Second)

		panic("i panicked after 10 seconds")
	}()

	name := c.Param("name")
	if name == "" {
		c.Log("Name came empty")
		name = "World"
	}

	return fmt.Sprintf("Hello %s!", name), nil
}

Expected behavior
App should not crash

Screenshots
Image

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions