OSDN Git Service

main: Update error handling
authorMyles Watson <mylesgw@google.com>
Tue, 21 Mar 2017 17:24:20 +0000 (10:24 -0700)
committerMyles Watson <mylesgw@google.com>
Tue, 21 Mar 2017 17:46:08 +0000 (17:46 +0000)
Test: builds
Change-Id: Ibc6b1d94f49bd711e7844ae769c384f76d357f22

main/bte_logmsg.cc
main/bte_main.cc

index 98ff1cf..9df3c11 100644 (file)
@@ -175,7 +175,8 @@ void LogMsg(uint32_t trace_set_mask, const char* fmt_str, ...) {
       break;
     default:
       /* we should never get this */
-      LOG_ERROR(bt_layer_tags[trace_layer], "%s", buffer);
+      LOG_ERROR(bt_layer_tags[trace_layer], "!BAD TRACE TYPE! %s", buffer);
+      CHECK(TRACE_GET_TYPE(trace_set_mask) == TRACE_TYPE_ERROR);
       break;
   }
 }
index 35ded9d..58e44fd 100644 (file)
@@ -100,8 +100,10 @@ void bte_main_boot_entry(void) {
   module_init(get_module(INTEROP_MODULE));
 
   hci = hci_layer_get_interface();
-  if (!hci)
+  if (!hci) {
     LOG_ERROR(LOG_TAG, "%s could not get hci layer interface.", __func__);
+    return;
+  }
 
   btu_hci_msg_queue = fixed_queue_new(SIZE_MAX);
   if (btu_hci_msg_queue == NULL) {