In case the default role(lambda-basic-execution), or any role that gets passed in as parameter does not exist it would raise:
botocore.exceptions.ClientError: An error occurred (NoSuchEntity) when calling the GetRole operation: The role with name lambda-basic-execution cannot be found.
instead of
botocore.exceptions.ClientError: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The role defined for the function cannot be assumed by Lambda.
In case the default role(lambda-basic-execution), or any role that gets passed in as parameter does not exist it would raise: botocore.exceptions.ClientError: An error occurred (NoSuchEntity) when calling the GetRole operation: The role with name lambda-basic-execution cannot be found. instead of botocore.exceptions.ClientError: An error occurred (InvalidParameterValueException) when calling the CreateFunction operation: The role defined for the function cannot be assumed by Lambda.