Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8518783
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:04:47+00:00 2026-06-11T06:04:47+00:00

Say I have an application that uses thread to download files through HTTP or

  • 0

Say I have an application that uses thread to download files through HTTP or FTP. I can imagine a few things going wrong in the background that would require some error handling:

  • The distant host becomes unavailable.
  • The download speed is too slow.
  • Some data is corrupt (if checks in place).
  • No data is being sent.
  • Content doesn’t correspond with expected file type.
  • Reported size and data don’t correspond.
  • …

How could these be handled in such a way as to relay an error back to the main application ? Or abort if unrecoverable ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T06:04:48+00:00Added an answer on June 11, 2026 at 6:04 am

    This is a pretty general question with a number of possible solutions. It depends highly on what information the thread is currently reporting back to the main application. If, for example, it is returning some remote file-contents in a String then null could indicate some sort of problem with the data. If you want more specific information then you will need to maybe create some sort of JobStatus class that encapsulates some of the error conditions you mention. Maybe the class also includes the remote file contents or the actual work payload.

    In terms of passing back the information. The Runnable class could have some sort of getStatus() method if you are not using a Callable<...> and ExecutorService thread-pools. You could also pass a WorkRequest class into your Thread that it fills out for the job at hand which could include information about any errors encountered.

    Typically I tend to rely on logging to show the actual source and details of the problem and rely on exceptions thrown by Future.get() to relay back that my processing thread had some sort of problem. But again, it is hard to determine what makes sense in your environment without a lot more context.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Say I have an application in Linux that uses shared libraries ( .so files).
In my application, I would like to have DataTemplates such that I can say:
Let say i have one asp.net application that is having some page that uses
I have an application that uses coredata. The Download of data happens in a
I have an application written in Delphi 6 that uses the Indy 9.0.18 HTTP
Say I have an application that used an ORM (I am thinking of nHibernate
Hi Sitepoint wizard people, Say we have an admin application that has multiple users
Let say, I have a web application that allows users to upload images and
Let's say that I have an application frame, and I want to show a
Lets say that you have a following simple application: <form action=helloServlet method=post> Give name:<input

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.