@@ -500,7 +500,7 @@ def _handle_body(self, body: bytes, charset: str) -> None:
500
500
raise
501
501
except BaseException as e :
502
502
self .__logger .exception (e )
503
- self .send_error (JsonRPCErrors .PARSE_ERROR , f"{ type ( e ). __name__ } : { e } " )
503
+ self .send_error (JsonRPCErrors .PARSE_ERROR , f"{ e } " )
504
504
505
505
def _handle_messages (self , iterator : Iterator [JsonRPCMessage ]) -> None :
506
506
for m in iterator :
@@ -786,6 +786,9 @@ def _received_request_done(self, message: JsonRPCRequest, t: asyncio.Future[Any]
786
786
ex = t .exception ()
787
787
if ex is not None :
788
788
self .__logger .exception (ex , exc_info = ex )
789
+ if isinstance (ex , JsonRPCErrorException ):
790
+ raise ex
791
+
789
792
raise JsonRPCErrorException (
790
793
JsonRPCErrors .INTERNAL_ERROR ,
791
794
f"{ type (ex ).__name__ } : { ex } " ,
@@ -804,15 +807,15 @@ def _received_request_done(self, message: JsonRPCRequest, t: asyncio.Future[Any]
804
807
except JsonRPCErrorException as e :
805
808
self .send_error (
806
809
e .code ,
807
- e .message or f"{ type ( e ). __name__ } : { e } " ,
810
+ e .message or f"{ e } " ,
808
811
id = message .id ,
809
812
data = e .data ,
810
813
)
811
814
except BaseException as e :
812
815
self .__logger .exception (e )
813
816
self .send_error (
814
817
JsonRPCErrors .INTERNAL_ERROR ,
815
- f"{ type ( e ). __name__ } : { e } " ,
818
+ f"{ e } " ,
816
819
id = message .id ,
817
820
)
818
821
0 commit comments