简体   繁体   English

AWS API网关阶段名称错误处理

[英]AWS API gateway Stage name error handling

Consider I have created an API using with AWS API gateway with the following URL 考虑到我已使用带有以下URL的AWS API网关创建了API

https://0abcgdefg1.execute-api.ap-northeast-1.amazonaws.com/Employee/ . 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 / 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. 当阶段不存在时,没有APIGW不支持返回自定义错误信息。

I am also wondering why you need to return this error message to API user ? 我也想知道为什么您需要将此错误消息返回给API用户? can you provide details about your use case ? 您可以提供有关用例的详细信息吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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