code: func RecoverFromPanic(err *error) {
  	if r := recover(); r != nil {
  		// Same as stdlib http server code. Manually allocate stack trace buffer size
  		// to prevent excessively large logs
  		const size = 64 << 10
  		stacktrace := make([]byte, size)
  		stacktrace = stacktrace[:runtime.Stack(stacktrace, false)]
  
  		*err = fmt.Errorf(
  			"recovered from panic %q. (err=%v) Call stack:\n%s",
  			r,
  			*err,
  			stacktrace)
  	}
  }
docs: // RecoverFromPanic replaces the specified error with an error containing the
  // original error, and  the call tree when a panic occurs. This enables error
  // handlers to handle errors and panics the same way.