[CHORE]: x: T = None to x: Optional[T] = None (#24217)
This commit is contained in:
parent
106ab7f2a8
commit
5ab6bc283c
14 changed files with 29 additions and 25 deletions
|
|
@ -610,7 +610,7 @@ class QueueErrorEvent(AppQueueEvent):
|
|||
"""
|
||||
|
||||
event: QueueEvent = QueueEvent.ERROR
|
||||
error: Any = None
|
||||
error: Optional[Any] = None
|
||||
|
||||
|
||||
class QueuePingEvent(AppQueueEvent):
|
||||
|
|
|
|||
|
|
@ -52,7 +52,8 @@ class BasedGenerateTaskPipeline:
|
|||
elif isinstance(e, InvokeError | ValueError):
|
||||
err = e
|
||||
else:
|
||||
err = Exception(e.description if getattr(e, "description", None) is not None else str(e))
|
||||
description = getattr(e, "description", None)
|
||||
err = Exception(description if description is not None else str(e))
|
||||
|
||||
if not message_id or not session:
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue