Ejemplo n.º 1
0
// Retrieve the last error message from the current context
//
func (self *Client) GetLastError() error {
	if self.context != nil {
		msg := C.GoString(C.pa_strerror(C.pa_context_errno(self.context)))

		if msg != `` {
			return errors.New(msg)
		}
	}

	return nil
}
Ejemplo n.º 2
0
Archivo: error.go Proyecto: shazow/mog
func errorFromCode(e C.int) error {
	cstr := C.pa_strerror(e)
	return errors.New(C.GoString(cstr))
}
Ejemplo n.º 3
0
Archivo: simple.go Proyecto: kaey/pulse
// Error method calls pa_strerror to get descriptive error message.
func (err Err) Error() string {
	cstr := C.pa_strerror(C.int(err.no))
	return C.GoString(cstr)
}