Handle etcd connection error
This commit is contained in:
		
					parent
					
						
							
								feb334cf04
							
						
					
				
			
			
				commit
				
					
						92f985c857
					
				
			
		
					 1 changed files with 2 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -65,6 +65,8 @@ class Etcd3Wrapper:
 | 
			
		|||
            event_iterator = self.client.get_prefix(*args, **kwargs)
 | 
			
		||||
            for e in event_iterator:
 | 
			
		||||
                yield EtcdEntry(*e[::-1], value_in_json=value_in_json)
 | 
			
		||||
        except etcd3.exceptions.ConnectionFailedError as e:
 | 
			
		||||
            raise UncloudException("Cannot connect to etcd: {}".format(e))
 | 
			
		||||
        except Exception as err:
 | 
			
		||||
            if raise_exception:
 | 
			
		||||
                raise Exception('Exception in etcd_wrapper.get_prefix') from err
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue