better error message when aos schema not found.
Change-Id: Ib4e0249e88150160f19a8772c85a66bb2446b80d
Signed-off-by: Austin Schuh <austin.schuh@bluerivertech.com>
diff --git a/aos/configuration.cc b/aos/configuration.cc
index ad0a489..46e84f5 100644
--- a/aos/configuration.cc
+++ b/aos/configuration.cc
@@ -984,8 +984,20 @@
}
}
- CHECK(found_schema != nullptr)
- << ": Failed to find schema for " << FlatbufferToJson(c);
+ if (found_schema == nullptr) {
+ std::stringstream ss;
+ for (const aos::FlatbufferVector<reflection::Schema> &schema :
+ schemas) {
+ if (schema.message().root_table() == nullptr) {
+ continue;
+ }
+ auto name = schema.message().root_table()->name()->string_view();
+ ss << "\n\tname: " << name;
+ }
+ LOG(FATAL) << ": Failed to find schema for " << FlatbufferToJson(c)
+ << "\n\tThe following schemas were found:\n"
+ << ss.str();
+ }
// Now copy the message manually.
auto cached_schema = schema_cache.find(c->type()->string_view());