Questions tagged [thread-exceptions]
51 questions
                    
                    43
                    
            votes
                
                10 answers
            
        How to throw a checked exception from a java thread?
Hey, I'm writing a network application, in which I read packets of some custom binary format. And I'm starting a background thread to wait for incoming data. The problem is, that the compiler doesn't let me to put any code throwing (checked)…
         
    
    
        mik01aj
        
- 11,928
- 15
- 76
- 119
                    18
                    
            votes
                
                4 answers
            
        Evaluation requires a thread to run temporarily. Use the Watch window to perform the evaluation
I'm completely stuck. I'm testing MetaTrader API and getting next error when tries to run a method in the Immediate Window of VS 2010:
A first chance exception of type 'System.Threading.ThreadAbortException' occurred in mscorlib.dll
A first chance…
         
    
    
        abatishchev
        
- 98,240
- 88
- 296
- 433
                    10
                    
            votes
                
                2 answers
            
        Android : Caused by: android.os.NetworkOnMainThreadException
String response = getResultForRequest(url);
Where 'url' is JSON formatted which return bunch of data using http GET method.
public static String getResultForRequest(String urlString)
        throws IOException {
    URL url = new URL(urlString);
  …
         
    
    
        Dhruv
        
- 1,862
- 3
- 20
- 38
                    8
                    
            votes
                
                3 answers
            
        Why do AppDomain exceptions invariably terminate the application?
This is related to a previous question.
What I'm trying to understand now is how come UI thread exceptions can be prevented from terminating the application while non-UI exceptions can't be.
For reference, see this example.
Most importantly, what I…
         
    
    
        Mike Dinescu
        
- 54,171
- 16
- 118
- 151
                    7
                    
            votes
                
                4 answers
            
        Updating Views asynchronously
I am trying to populate a recyclerview with data from the web which I want to fetch asynchronously. 
I have a function loadData() which is called onCreateView() which first makes a loading Indicator visible, then calls the suspend function loading…
         
    
    
        Joschka Goes
        
- 103
- 1
- 6
                    7
                    
            votes
                
                3 answers
            
        'thread._local' object has no attribute
I was trying to change the logging format by adding a context filter. My Format is like this
FORMAT = "%(asctime)s %(VAL)s %(message)s"
This is the class I use to set the VAL in the format. 
class TEST:
  def __init__(self, val):
   …
         
    
    
        DoNNie_DarkO
        
- 367
- 3
- 5
- 15
                    4
                    
            votes
                
                4 answers
            
        How do I get the name of the thread that the exception occurred on?
I am handling thread exceptions but I want to get the name of the Thread that the exception occurred on.  It appears that when the thread exception fires the event stays on the main thread although I think the exception could have occurred on a…
         
    
    
        James
        
- 2,812
- 3
- 22
- 33
                    3
                    
            votes
                
                1 answer
            
        system.threading .threadAbortException error
I am taking over an existing website and I am trying to get the application running on my machine, however I can't launch the application because I get the following error.
System.Threading.ThreadAbortException…
         
    
    
        John
        
- 33
- 1
- 7
                    3
                    
            votes
                
                2 answers
            
        Below code runs successfully, so does it mean we can start thread twice?
Below code runs successfully, so does it mean we can start thread twice?
public class enu extends Thread {
    static int count = 0;
    public void run(){
        System.out.println("running count "+count++);
    }
    public static void…
         
    
    
        Sumit Ganjave
        
- 83
- 1
- 8
                    2
                    
            votes
                
                1 answer
            
        How to catch async exceptions with the safe-exceptions library?
I'm trying to dive into building concurrent and robust code with Haskell, and it was recommended that I use the safe-exceptions and async libraries. However, I'm having a hard time understanding how to handle non-fatal errors thrown within an async…
         
    
    
        hololeap
        
- 1,156
- 13
- 20
                    2
                    
            votes
                
                0 answers
            
        "Not enough space for thread data R6016" Python multiprocessing error showing not enough thread space
I am currently trying to create Hierarchical Clustering using Similarity Matrix on a dataset of 35K images. I am trying to build the similarity matrix by concatenating Gabor filters, zernike moments and HOG of the images. AS the process was slow, I…
         
    
    
        Spandan Samiran
        
- 21
- 4
                    2
                    
            votes
                
                1 answer
            
        My "MyException" which shows Toast causes trouble while thrown in threads. How should I reorganize Exception handling?
I have written my own Exception (MyException) and implemented Logging and showing Error Messages in Form of Toasts. Here is the shortform of it...
public class MyException extends Exception {
   public MyException(String msg) {
     …
         
    
    
        OneWorld
        
- 17,512
- 21
- 86
- 136
                    2
                    
            votes
                
                2 answers
            
        Android control the position of SurfaceView by WindowsManager.LayoutParams
How can I control the position of window?
I added the SurfaceView with WindowManager.LayoutParam into the WindowManager;
And I tried to change the x and y of WindowManager.LayoutParams in Thread;
But I only got the Wrong Thread…
         
    
    
        Yen
        
- 19
- 1
- 6
                    2
                    
            votes
                
                1 answer
            
        Using ThreadExceptionEventHandler: determine which thread caused the exception
Using the Application.ThreadExceptionEventHandler, is it possible to determine which thread caused the exception (the thread id)?
The same question applies to using the AppDomain.UnhandledExceptionEventHandler to catch non-UI thread exceptions.
If…
         
    
    
        Mike Dinescu
        
- 54,171
- 16
- 118
- 151
                    1
                    
            vote
                
                3 answers
            
        Application.ThreadException on WCF Service?
I can´t find a Application.ThreadException event to listen to on my WCF service. I suppose that this is for WinForms so is there a ThreadException event for WCF services? Or will they end up in AppDomain.CurrentDomain.UnhandledException?
         
    
    
        Banshee
        
- 15,376
- 38
- 128
- 219