mirror of
https://github.com/status-im/react-native.git
synced 2025-02-04 13:44:04 +00:00
Improve error message when a component descriptor is not implemented
Summary: This diff improves the error message that is displayed when a component descriptor is not implemented in C++ Reviewed By: shergin Differential Revision: D9093562 fbshipit-source-id: 930b381bc66c20af6fa160b09e7484bad4666e28
This commit is contained in:
parent
f9c86f05e9
commit
b8a50c7614
@ -22,7 +22,11 @@ const SharedComponentDescriptor ComponentDescriptorRegistry::operator[](const Sh
|
||||
}
|
||||
|
||||
const SharedComponentDescriptor ComponentDescriptorRegistry::operator[](const ComponentName &componentName) const {
|
||||
return _registryByName.at(componentName);
|
||||
auto it = _registryByName.find(componentName);
|
||||
if (it == _registryByName.end()) {
|
||||
throw std::invalid_argument(("Unable to find componentDescriptor for " + componentName).c_str());
|
||||
}
|
||||
return it->second;
|
||||
}
|
||||
|
||||
} // namespace react
|
||||
|
Loading…
x
Reference in New Issue
Block a user