def METHOD_NAME(msg):
    sink = Gst.ElementFactory.make('fakesink', None)
    def handoff(s, b, p):
        s.message_full(
            Gst.MessageType.ERROR,
            Gst.stream_error_quark(),
            Gst.StreamError.FAILED,
            msg,
            msg,
            "",
            "",
            0,
        )
    sink.props.signal_handoffs = True
    sink.props.sync = True
    sink.connect('handoff', handoff)
    return sink