Add anyio error to failable

pull/26/head
Guillermo Rodriguez 2023-10-07 10:14:53 -03:00
parent b372f50130
commit ad1a9ef9ea
No known key found for this signature in database
GPG Key ID: EC3AB66D5D83B392
1 changed files with 5 additions and 2 deletions

View File

@ -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