mirror of https://github.com/status-im/metro.git
add getter as public api for ErrorUtils._globalHandler
Summary:As discussed here #1194 . This add an getter the default handler, so that custom handler can be added (monkey patch?) without overwriting the default handler Closes https://github.com/facebook/react-native/pull/5575 Differential Revision: D2948994 fb-gh-sync-id: 2b6d1619cfe68f78b326c6d232b9bf57c489c45d shipit-source-id: 2b6d1619cfe68f78b326c6d232b9bf57c489c45d
This commit is contained in:
parent
b2a11aff51
commit
278b40ff69
|
@ -20,6 +20,9 @@ var ErrorUtils = {
|
|||
setGlobalHandler: function(fun) {
|
||||
ErrorUtils._globalHandler = fun;
|
||||
},
|
||||
getGlobalHandler: function() {
|
||||
return ErrorUtils._globalHandler;
|
||||
},
|
||||
reportError: function(error) {
|
||||
ErrorUtils._globalHandler && ErrorUtils._globalHandler(error);
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue