Skip to content
This repository has been archived by the owner on Nov 5, 2024. It is now read-only.

DescribeTrainingJob returns ValidationException instead of ResourceNotFoundException for non-existent resource #165

Closed
stobrien89 opened this issue Jan 7, 2022 · 2 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation sagemaker service-api This issue pertains to the AWS API

Comments

@stobrien89
Copy link
Member

Origin: boto/boto3#2808, Requester: @haandol

Describe the bug

describe_training_job method occurs ValidationException instead of ResourceNotFound for not existing resource.

Steps to reproduce

tested on boto3==1.17.43, botocore==1.20.43

import boto3                                                                       
import botocore                                                                    
                                                                                   
client = boto3.client('sagemaker')                                                 
                                                                                   
try:                                                                               
    print(client.describe_training_job(TrainingJobName='not-existing-training-job-name'))                
except client.exceptions.ResourceNotFound:                                         
    print('caught')                                                                
except botocore.exceptions.ClientError as error:                                   
    if error.response['Error']['Code'] == 'ResourceNotFound':                      
        print('caught inner')                                                      
    else:                                                                          
        print(error.response)                                                      
        print('common') 

Expected behavior

above code should raise ResourceNotFound error and print caught
but it raises ValidationException and prints common

Service team request: V341946505

@stobrien89 stobrien89 added bug Something isn't working sagemaker labels Jan 7, 2022
@stobrien89 stobrien89 self-assigned this Jan 7, 2022
@tim-finnigan tim-finnigan added documentation Improvements or additions to documentation service-api This issue pertains to the AWS API labels Aug 10, 2023
@tim-finnigan tim-finnigan removed their assignment Sep 27, 2023
@tim-finnigan
Copy link
Contributor

The service team is continuing to track this issue in their backlog. As mentioned in the original issue, this would likely be a documentation change rather than an API behavior change, because this is technically old behavior that would be backwards-incompatible if changed. For any additional documentation feedback you can use the Provide feedback link at the bottom of API documentation pages like DescribeTrainingJob.

@tim-finnigan tim-finnigan closed this as not planned Won't fix, can't repro, duplicate, stale Oct 30, 2024
Copy link

This issue is now closed.

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Improvements or additions to documentation sagemaker service-api This issue pertains to the AWS API
Projects
None yet
Development

No branches or pull requests

3 participants