How can I fail client replay if the response doesn't match?

I’d like to use mitmproxy to test a service using a recorded flow. One aspect of that is I’d like to validate that the responses from my service match the recorded responses and in case of a mismatch I’d like to close mitmdump with an error. Is there a way do do that?