fix(logs): remove warning logs for common/handled error events. (#2043)
* remove warning logs for common/handled error events. * re-add warn logs, but only if not handled Co-authored-by: Cristiano Coelho <cristianocca@hotmail.com>
This commit is contained in:
parent
e33eea6dcf
commit
279d6ae98c
|
@ -211,13 +211,16 @@ class WebView extends React.Component<AndroidWebViewProps, State> {
|
|||
onLoadingError = (event: WebViewErrorEvent) => {
|
||||
event.persist(); // persist this event because we need to store it
|
||||
const { onError, onLoadEnd } = this.props;
|
||||
|
||||
if (onError) {
|
||||
onError(event);
|
||||
} else {
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
}
|
||||
|
||||
if (onLoadEnd) {
|
||||
onLoadEnd(event);
|
||||
}
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
|
||||
this.setState({
|
||||
lastErrorEvent: event.nativeEvent,
|
||||
|
|
|
@ -195,13 +195,16 @@ class WebView extends React.Component<IOSWebViewProps, State> {
|
|||
onLoadingError = (event: WebViewErrorEvent) => {
|
||||
event.persist(); // persist this event because we need to store it
|
||||
const { onError, onLoadEnd } = this.props;
|
||||
|
||||
if (onLoadEnd) {
|
||||
onLoadEnd(event);
|
||||
}
|
||||
|
||||
if (onError) {
|
||||
onError(event);
|
||||
} else {
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
}
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
|
||||
this.setState({
|
||||
lastErrorEvent: event.nativeEvent,
|
||||
|
|
|
@ -183,13 +183,16 @@ class WebView extends React.Component<MacOSWebViewProps, State> {
|
|||
onLoadingError = (event: WebViewErrorEvent) => {
|
||||
event.persist(); // persist this event because we need to store it
|
||||
const { onError, onLoadEnd } = this.props;
|
||||
|
||||
if (onLoadEnd) {
|
||||
onLoadEnd(event);
|
||||
}
|
||||
|
||||
if (onError) {
|
||||
onError(event);
|
||||
} else {
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
}
|
||||
console.warn('Encountered an error loading page', event.nativeEvent);
|
||||
|
||||
this.setState({
|
||||
lastErrorEvent: event.nativeEvent,
|
||||
|
|
Loading…
Reference in New Issue