未验证 提交 f804a1fc 编写于 作者: C Chris Bracken 提交者: GitHub

Improve error message when kernel not set (#6924)

Pushes the check up front so that we don't always land on the
application_kernel_list_asset error message, which may be misleading to
readers.

Also switches the empty check to only emit in debug builds, since this
is almost certainly not a runtime error but a programmer error.
上级 eebc6a58
......@@ -153,6 +153,13 @@ std::unique_ptr<IsolateConfiguration> IsolateConfiguration::InferFromSettings(
return nullptr;
}
if (settings.application_kernel_asset.empty() &&
settings.application_kernel_list_asset.empty()) {
FML_DLOG(ERROR) << "application_kernel_asset or "
"application_kernel_list_asset must be set";
return nullptr;
}
// Running from kernel snapshot.
{
std::unique_ptr<fml::Mapping> kernel =
......@@ -164,10 +171,6 @@ std::unique_ptr<IsolateConfiguration> IsolateConfiguration::InferFromSettings(
// Running from kernel divided into several pieces (for sharing).
{
if (settings.application_kernel_list_asset.empty()) {
FML_LOG(ERROR) << "Application kernel list asset not set";
return nullptr;
}
std::unique_ptr<fml::Mapping> kernel_list =
asset_manager->GetAsMapping(settings.application_kernel_list_asset);
if (!kernel_list) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册