From 401abe976395eefa9e9a9097daf34ff224463e02 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Fri, 18 Dec 2020 13:33:51 +0800 Subject: [PATCH] bugfix --- ahserver/processorResource.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ahserver/processorResource.py b/ahserver/processorResource.py index ed05072..f4dd857 100644 --- a/ahserver/processorResource.py +++ b/ahserver/processorResource.py @@ -1,5 +1,6 @@ import os import re +from traceback import print_exc import asyncio @@ -40,7 +41,7 @@ from .filestorage import FileStorage from .restful import DBCrud from .dbadmin import DBAdmin from .filedownload import file_download, path_decode -from utils import unicode_escape +from .utils import unicode_escape def getHeaderLang(request): al = request.headers.get('Accept-Language') @@ -234,7 +235,7 @@ class ProcessorResource(StaticResource,Url2File): if processor: return await processor.handle(request) - filepath = self.url2filepath(str(request.url)) + filepath = self.url2file(str(request.url)) if filepath and self.isHtml(filepath): return await html_handle(request, filepath) @@ -265,7 +266,9 @@ class ProcessorResource(StaticResource,Url2File): return True if b.stratswith(''): return True - except: + except Exception as e: + print_exc() + print(e) return False def url2processor(self, request, url):