From ce4324b06f02c0a31a51cd6b851c6ab22c7d0b87 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Thu, 2 Apr 2026 10:45:24 +0800 Subject: [PATCH] bugfix --- ahserver/baseProcessor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ahserver/baseProcessor.py b/ahserver/baseProcessor.py index a6e8b9b..08bc7e4 100644 --- a/ahserver/baseProcessor.py +++ b/ahserver/baseProcessor.py @@ -101,7 +101,7 @@ class BaseProcessor: self.set_response_headers(self.retResponse) return self.retResponse elif inspect.iscoroutine(self.content): - e = Exception(f'{self.content.__name__} is a coroutine') + e = Exception(f'{request.path}:{self.content.__name__} is a coroutine') exception(f'{e}') raise e elif isinstance(self.content, Response): @@ -137,6 +137,10 @@ class BaseProcessor: self.headers['Content-Type'] = "application/json; utf-8" self.headers['Access-Control-Expose-Headers'] = 'Set-Cookie' + if not isinstance(self.content, str): + e = Exception(f'{request.path} return data type error, {type(self.content)}') + exception(f'{e}') + raise e resp = Response(text=self.content,headers=self.headers) self.set_response_headers(resp) return resp