func dataError(prefix string, data *C.pn_data_t) error { err := internal.PnError(unsafe.Pointer(C.pn_data_error(data))) if err != nil { err = internal.Errorf("%s: %s", prefix, err.(internal.Error)) } return err }
func (m *message) Decode(data []byte) error { m.Clear() if len(data) == 0 { return internal.Errorf("empty buffer for decode") } if C.pn_message_decode(m.pn, cPtr(data), cLen(data)) < 0 { return internal.Errorf("decoding message: %s", internal.PnError(unsafe.Pointer(C.pn_message_error(m.pn)))) } return nil }
func (t Transport) Error() error { return internal.PnError(unsafe.Pointer(C.pn_transport_error(t.pn))) }
func (c Connection) Error() error { return internal.PnError(unsafe.Pointer(C.pn_connection_error(c.pn))) }
func (l Link) Error() error { return internal.PnError(unsafe.Pointer(C.pn_link_error(l.pn))) }
func (s Session) Error() error { return internal.PnError(unsafe.Pointer(C.pn_session_error(s.pn))) }