简体   繁体   中英

AWS API gateway Stage name error handling

Consider I have created an API using with AWS API gateway with the following URL

https://0abcgdefg1.execute-api.ap-northeast-1.amazonaws.com/Employee/ .

is it possible to create an error message if the end user tried a nonexisting stage name? For eg

https://0abcgdefg1.execute-api.ap-northeast-1.amazonaws.com/ Employee1 /

is it possible to give some error information like below?

{
    "errors": [
        {
            "message": "Stage name Employee1doesn't exist",
            "type": "InvalidStageError"
        }
    ]
}

No APIGW do not support returning custom error information when stage does not exits.

I am also wondering why you need to return this error message to API user ? can you provide details about your use case ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM