Re: [Audacity-devel] Audacity Exception, error, and fault handling
A free multi-track audio editor and recorder
                
                Brought to you by:
                
                    aosiniao
                    
                
            
            
        
        
        
    | 
     
      
      
      From: Matt B. <mbr...@cs...> - 2004-11-30 16:10:50
      
     
   | 
Ryan Vaughan wrote: > I'm not asking you guys to do the assignment for me, but a quick grep > of the code found a decided lack of try, catch, or throws statements. > I have noticed wxMessageBox is used to report some errors, I was > wondering if you could point out any common error reporting techniques > I could search for. Audacity does not use C++ exception handling. This is at least partly because the APIs we use (and much of our own code) were originally developed at a time when compiler support for exceptions was poor or inconsistent. In particular, there was a significant speed penalty for code that used exception handling. I'm not sure if this is still true under more modern compilers. Instead, we mostly use the C convention of returning error values from functions. I don't think we are particularly consistent about this; you will have to look for examples to see the exact style(s) we use. You should look at our use of the error-handling APIs in various libraries, including wxWidgets, Ogg Vorbis, FLAC++, etc. Some of these are asynchronous APIs, which have somewhat different error-handling styles. (For example, see import/ImportFLAC.cpp in CVS HEAD.)  |