This structure effectively mimics a try/catch/finally block using Go's `panic` and `recover`.