diff --git a/wapitiCore/attack/mod_wapp.py b/wapitiCore/attack/mod_wapp.py index 680cd77ea..a6bd35160 100644 --- a/wapitiCore/attack/mod_wapp.py +++ b/wapitiCore/attack/mod_wapp.py @@ -318,7 +318,7 @@ async def _detect_applications_headless(self, url: str) -> dict: logging.exception(exception) continue - except (ArsenicError, FileNotFoundError): + except (ArsenicError, FileNotFoundError, asyncio.TimeoutError): # Geckodriver may be missing, etc pass diff --git a/wapitiCore/net/auth.py b/wapitiCore/net/auth.py index 547dd9515..78be05c25 100644 --- a/wapitiCore/net/auth.py +++ b/wapitiCore/net/auth.py @@ -112,7 +112,7 @@ async def _async_try_login_post( await asyncio.sleep(.1) page_source = await headless_client.get_page_source() crawler_configuration.cookies = headless_cookies_to_cookiejar(await headless_client.get_all_cookies()) - except ArsenicError as exception: + except (ArsenicError, asyncio.TimeoutError) as exception: logging.error(_("[!] {} with URL {}").format(exception.__class__.__name__, auth_url)) return False, {}, [] else: diff --git a/wapitiCore/net/intercepting_explorer.py b/wapitiCore/net/intercepting_explorer.py index 8a7cfbb91..b48155b84 100644 --- a/wapitiCore/net/intercepting_explorer.py +++ b/wapitiCore/net/intercepting_explorer.py @@ -18,6 +18,8 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA import asyncio import re +import sys +from traceback import print_tb from typing import Tuple, List, AsyncIterator, Dict, Optional, Deque from logging import getLogger, WARNING, CRITICAL from http.cookiejar import CookieJar @@ -322,7 +324,7 @@ async def launch_headless_explorer( page_source = await headless_client.get_page_source() await click_in_webpage(headless_client, request, wait_time) - except ArsenicError as exception: + except (ArsenicError, asyncio.TimeoutError) as exception: logging.error(f"{request} generated an exception: {exception.__class__.__name__}") continue else: @@ -350,8 +352,8 @@ async def launch_headless_explorer( to_explore.append(next_request) except Exception as exception: # pylint: disable=broad-except - # exception_traceback = sys.exc_info()[2] - # print_tb(exception_traceback) + exception_traceback = sys.exc_info()[2] + print_tb(exception_traceback) frm = inspect.trace()[-1] mod = inspect.getmodule(frm[0]) logging.error(