onError does not catch bad URIs
See original GitHub issueBug description:
A misspecified URI throws an exception that onError does not catch. Instead, we get a red box error: Exception thrown while executing UI block: https:// is not a file URL
(when using just https://
as the uri).
To Reproduce: import React, { Component } from ‘react’; import { WebView } from ‘react-native-webview’;
class App extends Component {
render() {
return (
<WebView
source={{ uri: 'https://' }}
onError={syntheticEvent => {
const { nativeEvent } = syntheticEvent;
console.warn('WebView error: ', nativeEvent);
}}
style={{ marginTop: 20 }}
/>
);
}
}
export default App;
Expected behavior: I would expect there to be some way to catch this type of exception gracefully.
Environment:
- OS: iOS
- OS version: simulator
- react-native version: 0.61.4
- react-native-webview version: 8.0.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:8
Top Results From Across the Web
Why onError in <Image> calls every time even if Image uri is ...
i want to load static Image if URL based Image is failed on load. i've used onError method to achieve this. but onError...
Read more >Handling operation errors - Apollo GraphQL Docs
The onError link can retry a failed operation based on the type of GraphQL error that's returned. For example, when using token-based authentication,...
Read more >URIError: malformed URI sequence - MDN Web Docs - Mozilla
The JavaScript exception "malformed URI sequence" occurs when URI encoding or decoding wasn't successful. Message. URIError: URI malformed (V8-based) ...
Read more >Exception Clause - Apache Camel
How Does Camel Select Which Clause Should Handle a Given Thrown Exception? Configuring RedeliveryPolicy (redeliver options); No redelivery is default for ...
Read more >Guide to Spring Boot REST API Error Handling - Toptal
So if you are handling the REST requests directly on Jersey it should not handle the exceptions. Can't you use @RequestMapping? Bruno. I'm...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello, still searching for solutions on this… I get an error in my logs
backend.js:32 Error opening URL: Error: Unable to open URL [...]
without having onError firedSame issue