changed RecoverHandleFunction signature to allow more control of the http response