myfunction (): tries to ping elasticsearch DB using .ping and returns the object
other function(): try: call to my_f