forked from goodboy/tractor
				
			Fix exception typing
							parent
							
								
									348148ff1e
								
							
						
					
					
						commit
						1a69727b75
					
				| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
Our classy exception set.
 | 
					Our classy exception set.
 | 
				
			||||||
"""
 | 
					"""
 | 
				
			||||||
from typing import Dict, Any, Optional
 | 
					from typing import Dict, Any, Optional, Type
 | 
				
			||||||
import importlib
 | 
					import importlib
 | 
				
			||||||
import builtins
 | 
					import builtins
 | 
				
			||||||
import traceback
 | 
					import traceback
 | 
				
			||||||
| 
						 | 
					@ -18,7 +18,7 @@ class RemoteActorError(Exception):
 | 
				
			||||||
    def __init__(
 | 
					    def __init__(
 | 
				
			||||||
        self,
 | 
					        self,
 | 
				
			||||||
        message: str,
 | 
					        message: str,
 | 
				
			||||||
        suberror_type: Optional[Exception] = None,
 | 
					        suberror_type: Optional[Type[BaseException]] = None,
 | 
				
			||||||
        **msgdata
 | 
					        **msgdata
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    ) -> None:
 | 
					    ) -> None:
 | 
				
			||||||
| 
						 | 
					@ -84,7 +84,7 @@ def unpack_error(
 | 
				
			||||||
    tb_str = error.get('tb_str', '')
 | 
					    tb_str = error.get('tb_str', '')
 | 
				
			||||||
    message = f"{chan.uid}\n" + tb_str
 | 
					    message = f"{chan.uid}\n" + tb_str
 | 
				
			||||||
    type_name = error['type_str']
 | 
					    type_name = error['type_str']
 | 
				
			||||||
    suberror_type = Exception
 | 
					    suberror_type: Type[BaseException] = Exception
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if type_name == 'ContextCancelled':
 | 
					    if type_name == 'ContextCancelled':
 | 
				
			||||||
        err_type = ContextCancelled
 | 
					        err_type = ContextCancelled
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue