class_docstr: Sets up an Amazon SageMaker Collection.
docstr: Checks if the error is related to the access error and provide the relevant message.
  
  Args:
      err: The client error to check.
docstr_tok: ["Checks","if","the","error","is","related","to","the","access","error","and","provide","the","relevant","message",".","Args",":","err",":","The","client","error","to","check","."]
code: def _check_access_error(self, err: ClientError):
      """Checks if the error is related to the access error and provide the relevant message.
  
      Args:
          err: The client error to check.
      """
  
      error_code = err.response["Error"]["Code"]
      if error_code == "AccessDeniedException":
          raise Exception(
              f"{error_code}: This account needs to attach a custom policy "
              "to the user role to gain access to Collections. Refer - "
              "https://docs.aws.amazon.com/sagemaker/latest/dg/modelcollections-permissions.html"
          )
  
imports: from __future__ import absolute_import
  import json
  import time
  from typing import List
  from botocore.exceptions import ClientError
  from sagemaker.session import Session
label_desc: Use image node_id 2 for calling the Collection obj's underlying member method code with example usage: obj._check_access_error(err) without return types