ibm-functions / package-cloud-object-storage

Deploy a Cloud Object Storage Package for IBM Functions.
Apache License 2.0
2 stars 9 forks source link

Python package: action source code does not import ClientError #42

Open ptitzler opened 5 years ago

ptitzler commented 5 years ago

I imported the cloud-object-storage package and noticed that the source code does not import ClientError in many actions, e.g. object-read, object-write, object-delete.

import sys
import json
import ibm_boto3
from ibm_botocore.client import Config

def main(args):
  resultsGetParams = getParamsCOS(args)
  cos = resultsGetParams['cos']
  params = resultsGetParams['params']
  bucket = params['bucket']
  key = params['key']
   ...
  except ClientError as e:
    print(e)
    raise e

In case an exception is raised this code blows up because there's a from ibm_botocore.client import ClientError missing.