Comments (2)
Hey!
At this moment, I don't think it's possible to get the original native error. I'm also not sure whether NativeScript has something to provide in that. It's probably better to transform these errors in the plugin to standardized TypeScript errors.
I would accept Pull Requests for that.
from nativescript-http.
Thanks for the answer.
We cannot get the actual native error indeed, I meant the 'wrapped' Javascript version.
On iOS the error returned by session.dataTaskWithRequestCompletionHandler(urlRequest, function (data, response, error) {...}
seems to be a 'wrapped' Javascript NSError. On Android though, I'm not sure what errors are mapped to (probably some subclass of a java Exception ?).
I guess it would be somewhat complicated to map iOS NSErrors and Android Exceptions to various error types (no network, timeout etc...) but it might be nice to have a way to retrieve the 'original' (but not native :) ) error.
I'm not super familiar with TypeScript errors, but it looks like one would have to create a subclass for that ? (And add an nativeError / underlyingError property to the Error class).
I don't have a lot of time to delve more into this right now but may try to make a pull request later.
from nativescript-http.
Related Issues (20)
- Update OkHttp 4.10 -> 4.12
- NativeScript 7 update HOT 12
- Keep uploading images in background on iOS HOT 1
- [FR] run big opps in threads HOT 1
- Cannot find runtime for instance=com.tns.gen.okhttp3.Callback HOT 2
- Does This Support Binary File Upload (Image) in Formdata Submit HOT 16
- Callback upload or download available? HOT 1
- Why not suggest a custom webpack configuration? HOT 2
- is there support to select/send a client certificate(for authentication PKCS12) during the TLS handshake? HOT 6
- Public key pinning...backup keys HOT 2
- [Question] Webpack 5 Error HOT 8
- NS8 Webpack path replacement module does not take into account Windows 10 backslashes HOT 9
- ReferenceError: Cannot access 'Cache' before initialization HOT 1
- [Review Request] Roadmap Step - Cache Control HOT 2
- how to read cookies HOT 1
- Unexpected end of JSON input HOT 5
- Support for HTTP/3? HOT 1
- Feature request: Certificate transparency for Android HOT 1
- Request hangs when using a Self-Signed certificate HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-http.