logging: Don't throw from Activity destructor
Move definition of destructor to logging.cc for access to util.hh's ignoreException.
This commit is contained in:
		
							parent
							
								
									70dbac7491
								
							
						
					
					
						commit
						e917c05628
					
				
					 2 changed files with 9 additions and 2 deletions
				
			
		|  | @ -221,4 +221,12 @@ bool handleJSONLogMessage(const std::string & msg, | ||||||
|     return true; |     return true; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | Activity::~Activity() { | ||||||
|  |     try { | ||||||
|  |         logger.stopActivity(id); | ||||||
|  |     } catch (...) { | ||||||
|  |         ignoreException(); | ||||||
|  |     } | ||||||
|  | } | ||||||
|  | 
 | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -94,8 +94,7 @@ struct Activity | ||||||
| 
 | 
 | ||||||
|     Activity(const Activity & act) = delete; |     Activity(const Activity & act) = delete; | ||||||
| 
 | 
 | ||||||
|     ~Activity() |     ~Activity(); | ||||||
|     { logger.stopActivity(id); } |  | ||||||
| 
 | 
 | ||||||
|     void progress(uint64_t done = 0, uint64_t expected = 0, uint64_t running = 0, uint64_t failed = 0) const |     void progress(uint64_t done = 0, uint64_t expected = 0, uint64_t running = 0, uint64_t failed = 0) const | ||||||
|     { result(resProgress, done, expected, running, failed); } |     { result(resProgress, done, expected, running, failed); } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue