mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Improve error messages when enum members are missing (#51502)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/51502 While working on a case for Editor on mac, it took me a while to figure out what enum was the root cause: {F1978470518} Adding the blaming enum name in the error message would have made my life much easier. ## Changelog: [GENERAL][Added] - Improve error messages when enum members are missing Reviewed By: rshest Differential Revision: D75141414 fbshipit-source-id: 3625d817b218788891252add225f8fffb99e3145
This commit is contained in:
committed by
Facebook GitHub Bot
parent
5489e18abc
commit
12ced22f70
@@ -434,7 +434,7 @@ function generateEnum(
|
||||
)
|
||||
.join(' else ') +
|
||||
` else {
|
||||
throw jsi::JSError(rt, "No appropriate enum member found for value");
|
||||
throw jsi::JSError(rt, "No appropriate enum member found for value in ${enumName}");
|
||||
}`;
|
||||
|
||||
const toCases =
|
||||
@@ -446,7 +446,7 @@ function generateEnum(
|
||||
)
|
||||
.join(' else ') +
|
||||
` else {
|
||||
throw jsi::JSError(rt, "No appropriate enum member found for enum value");
|
||||
throw jsi::JSError(rt, "No appropriate enum member found for enum value in ${enumName}");
|
||||
}`;
|
||||
|
||||
return EnumTemplate({
|
||||
|
||||
Reference in New Issue
Block a user