improve error handling for postreceive