fix: error type get wrong (#2403)

This commit is contained in:
takatost 2024-02-06 12:24:48 +08:00 • committed by GitHub
commit 42344795cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -477,7 +477,11 @@ class GenerateTaskPipeline:
}
# Determine the response based on the type of exception
data = error_responses.get(type(e))
data = None
for k, v in error_responses.items():
if isinstance(e, k):
data = v
if data:
data.setdefault('message', getattr(e, 'description', str(e)))
else: