Add test for failure in context results

Add a test to ensure the failure is correctly encoded and returned when one of
the markers in the context has an exception.