mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
add rules to prefer Error objects to be thrown and rejected (#54229)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54229 Changelog: [General][Added] Added eslint rule to warn when a non-error is being thrown from a function or rejected for a promise. Reviewed By: huntie Differential Revision: D85237916 fbshipit-source-id: e0e4fbc6b4620a19be1959d3953856c7e44ad4e0
This commit is contained in:
committed by
meta-codesync[bot]
parent
9cadfe6607
commit
94995fdd9f
@@ -30,5 +30,5 @@ export function takeScreenshot(
|
||||
if (NativeModule != null) {
|
||||
return NativeModule.takeScreenshot(id, options);
|
||||
}
|
||||
return Promise.reject();
|
||||
return Promise.reject(new Error('ScreenshotManager is not defined.'));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user