英文:
How to obtain exact error on cognito failure
问题
我想知道当Cognito发生内部错误时,我可以在哪里找到确切的错误信息。例如,当我列出用户池的用户时,Cognito返回一个内部错误,我应该在哪里找到返回的确切错误信息。谢谢。
英文:
I was wondering where can I find the exact error that cognito would send when it would have an internal error. For example, I list the users for a pool and cognito returns an internal error, where could I find the exact error that gets returned. Thanks.
答案1
得分: 1
在Cognito API 参考文档中,您可以找到返回不同 API 调用的错误列表,以下是以ListUsers为例的错误列表:
InternalErrorException
当 Amazon Cognito 遇到内部错误时,会抛出此异常。
HTTP 状态码:500
InvalidParameterException
当 Amazon Cognito 服务遇到无效参数时,会抛出此异常。
HTTP 状态码:400
NotAuthorizedException
当用户未经授权时,会抛出此异常。
HTTP 状态码:400
ResourceNotFoundException
当 Amazon Cognito 服务无法找到请求的资源时,会抛出此异常。
HTTP 状态码:400
TooManyRequestsException
当用户对于给定操作发出了过多的请求时,会抛出此异常。
HTTP 状态码:400
由于您标记了"Go":如果您正在使用 Go SDK,您将获得一个 awserr.Error 对象,您可以使用其 Code 和 Message 方法来了解返回的错误信息。有关更多信息,请参阅Go SDK 文档。
英文:
In the Cognito API Reference you can find a list of errors that are being returned from the different API calls, here is the error list for ListUsers for example:
> InternalErrorException
This exception is thrown when Amazon Cognito encounters an internal error.
HTTP Status Code: 500
> InvalidParameterException
This exception is thrown when the Amazon Cognito service encounters an invalid parameter.
HTTP Status Code: 400
> NotAuthorizedException
This exception is thrown when a user isn't authorized.
HTTP Status Code: 400
> ResourceNotFoundException
This exception is thrown when the Amazon Cognito service can't find the requested resource.
HTTP Status Code: 400
>TooManyRequestsException
This exception is thrown when the user has made too many requests for a given operation.
HTTP Status Code: 400
Since you have tagged "Go": If you are using the Go SDK you get an awserr.Error and you can use its Code and Message methods to learn more about the error that has been returned. See the Go SDK Documentation for more information.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论