Skip to content
This repository was archived by the owner on Apr 18, 2026. It is now read-only.

Add support for Go recovered panics#98

Open
kasparjarek wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
kasparjarek:go-recovered-panics
Open

Add support for Go recovered panics#98
kasparjarek wants to merge 1 commit into
GoogleCloudPlatform:masterfrom
kasparjarek:go-recovered-panics

Conversation

@kasparjarek
Copy link
Copy Markdown

When Go panic is recovered and thrown again it duplicates the first line of panic suffixed with [recovered]. The finite automaton is currently unable to recognise this panic output.

panic: foo [recovered]
	panic: foo [recovered]
	panic: foo [recovered]
	panic: foo

goroutine 1 [running]:
main.recoverAndPanic()
	/tmp/sandbox1820875720/prog.go:12 +0x34
panic({0x459120, 0x476600})
	/usr/local/go-faketime/src/runtime/panic.go:838 +0x207
main.recoverAndPanic()
	/tmp/sandbox1820875720/prog.go:12 +0x34
panic({0x459120, 0x476600})
	/usr/local/go-faketime/src/runtime/panic.go:838 +0x207
main.recoverAndPanic()
	/tmp/sandbox1820875720/prog.go:12 +0x34
panic({0x459120, 0x476600})
	/usr/local/go-faketime/src/runtime/panic.go:838 +0x207
main.main()
	/tmp/sandbox1820875720/prog.go:7 +0x5d

The output is produced by following code:

package main

func main() {
	defer recoverAndPanic()
	defer recoverAndPanic()
	defer recoverAndPanic()
	panic("foo")
}

func recoverAndPanic() {
	if r := recover(); r != nil {
		panic(r)
	}
}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant