def check_rpc_status(status):
 status.check_initialized()
 error_class = RpcError.from_state(status.state)
 if (error_class is not None):
  if (error_class is ApplicationError):
   raise error_class(status.error_message, status.error_name)
  else:
   raise error_class(status.error_message)

def check_rpc_status ( status ) : status . check_initialized ( ) error_class = RpcError . from_state ( status . state ) if ( error_class is not None ) : if ( error_class is ApplicationError ) : raise error_class ( status . error_message , status . error_name ) else : raise error_class ( status . error_message )
function converts an error status to a raised exception .