diff --git a/src/device.c b/src/device.c
index 4f29ba9..60820b7 100644
--- a/src/device.c
+++ b/src/device.c
struct gatt_primary *prim;
GSList *l;
- if (device->attrib == NULL) {
+ DBG("status %u", status);
+
+ if (device->attrib == NULL || status) {
struct browse_req *req = device->browse;
- error("Disconnected while doing included discovery");
+ if (status)
+ error("Find included services failed: %s (%d)",
+ att_ecode2str(status), status);
+ else
+ error("Disconnected while doing included discovery");
if (!req)
goto complete;
goto complete;
}
- if (status != 0) {
- error("Find included services failed: %s (%d)",
- att_ecode2str(status), status);
- goto next;
- }
-
if (includes == NULL)
goto next;