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:
Cristiano Coelho 2021-07-01 09:29:44 -03:00 committed by GitHub
parent e33eea6dcf
commit 279d6ae98c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 3 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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,