XCTest assert for specific Error?

Is there a simple way to unit test that I'll get a specific error thrown? I currently stuck writing this ugliness.


    func testEncodedDataFrameMustHaveStream() {
        do {
            _ = try DataFrame(stream: Http2Stream.connectionStream)
        } catch Http2Error.protocolError {
            // Good!
        } catch {
            XCTFail("Should have thrown a protocol error")
        }
    }


There apparently used to be something like XCTAssertThrowsSpecific but I'm not finding that any longer.

XCTest assert for specific Error?
 
 
Q