Using error handler
This commit is contained in:
parent
ba9a9757d3
commit
67574e7276
|
@ -287,13 +287,13 @@ func setCfg(dev *QEncDevice, cfg QEncCfg, val uint8) (err error) {
|
||||||
func sendDataWrapper(dev *QEncDevice, data []byte, cmd QEncCmd, id uint32) (ret []byte, err error) {
|
func sendDataWrapper(dev *QEncDevice, data []byte, cmd QEncCmd, id uint32) (ret []byte, err error) {
|
||||||
if err = dev.Open(); err != nil {
|
if err = dev.Open(); err != nil {
|
||||||
if QEncInfoHandler != nil {
|
if QEncInfoHandler != nil {
|
||||||
QEncInfoHandler(err.Error())
|
QEncErrHandler(err)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
if err = dev.Lock(); err != nil {
|
if err = dev.Lock(); err != nil {
|
||||||
if QEncInfoHandler != nil {
|
if QEncInfoHandler != nil {
|
||||||
QEncInfoHandler(err.Error())
|
QEncErrHandler(err)
|
||||||
}
|
}
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue