mirror of https://github.com/skygpu/skynet.git
				
				
				
			Add anyio error to failable
							parent
							
								
									b372f50130
								
							
						
					
					
						commit
						ad1a9ef9ea
					
				| 
						 | 
					@ -8,6 +8,8 @@ import time
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import asks
 | 
					import asks
 | 
				
			||||||
 | 
					import anyio
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from PIL import Image
 | 
					from PIL import Image
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from leap.cleos import CLEOS
 | 
					from leap.cleos import CLEOS
 | 
				
			||||||
| 
						 | 
					@ -23,10 +25,11 @@ async def failable(fn: partial, ret_fail=None):
 | 
				
			||||||
        return await fn()
 | 
					        return await fn()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    except (
 | 
					    except (
 | 
				
			||||||
 | 
					        OSError,
 | 
				
			||||||
 | 
					        json.JSONDecodeError,
 | 
				
			||||||
        asks.errors.RequestTimeout,
 | 
					        asks.errors.RequestTimeout,
 | 
				
			||||||
        asks.errors.BadHttpResponse,
 | 
					        asks.errors.BadHttpResponse,
 | 
				
			||||||
        json.JSONDecodeError,
 | 
					        anyio.BrokenResourceError
 | 
				
			||||||
        OSError
 | 
					 | 
				
			||||||
    ):
 | 
					    ):
 | 
				
			||||||
        return ret_fail
 | 
					        return ret_fail
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue