apache / airavata-mft

Apache Airavata Managed File Transfer Services
https://airavata.apache.org
Apache License 2.0
32 stars 39 forks source link

#94 Rich client error messages #100

Closed impiyush83 closed 1 year ago

impiyush83 commented 1 year ago

@DImuthuUpe created a clean PR

94

DImuthuUpe commented 1 year ago

Thanks for the fix @impiyush83. Because the error messages are repeated, can you move them all into one utility function and call that in every place where you see this exception? I suggest something like following

error_handler.py

def handle_error(ex):
    if ex is grpc.RpcError
      if  ex.code() == grpc.StatusCode.UNAVAILABLE:
        print(f' MFT server is unavailable. ')
impiyush83 commented 1 year ago

@DImuthuUpe Updated PR with a utility function.

DImuthuUpe commented 1 year ago

Looks good to me. Thanks @impiyush83