Comments (5)
Thanks, I'm glad you are finding it useful.
If I were you, I'd try/catch the portion of your application code that results in this function being executed and crashing down the line. This way your application can catch the exception and let the user know they provided an invalid path.
from simple-torrent-android.
Sorry, I did state the issue clearly.
this function is called by your SDK after I execute:
AsyncTask.execute(new Runnable() {
@Override
public void run() {
torrentSession.start(context, url);
}
});
some users cannot connect to our host due to internet censorship, and this method (torrentSession.start(context, url)) cause a crash instead of throwing exceptions in callback listener.
I'm just suggesting that it will be better and an improvement that any errors related to url should be put in TorrentSessionListener.class
@Override
public void onTorrentError(@NotNull TorrentHandle torrentHandle, @NotNull TorrentSessionStatus torrentSessionStatus) {
}
Thanks for your reply. :)
from simple-torrent-android.
Thanks for the suggestion. Unfortunately, we can't use onTorrentError(...) callback as there is no TorrentHandle or TorrentSessionStatus instances available at this time. Even if we could, these callbacks are really just bubbling up events from the underlying jlibtorrent implementation so I wouldn't want to overload them.
Would the following work for your use case?
AsyncTask.execute(new Runnable() {
@Override
public void run() {
try {
torrentSession.start(context, url);
catch(ex: Exception) {
// Take action to notify the user something went wrong
}
}
});
from simple-torrent-android.
Thanks for your reply.
I will try this way, or find other ways.
from simple-torrent-android.
No problem, good luck!
from simple-torrent-android.
Related Issues (6)
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 simple-torrent-android.