1

我正在为 Amazon SNS 使用 Python 2.7 和 boto 库。当我收到带有异常详细信息的异常时,我正在尝试发送通知。在某些情况下,异常字符串包含类似“ --->”或“ \”的字符串。我怀疑这些字符会导致BotoServerError错误请求。

完整的异常字符串:

boto.exception.BotoServerError: BotoServerError: 400 Bad Request None

防止我的应用程序出现此异常的最佳方法是什么?

编辑:这是我发送消息的代码:

sns = boto.sns.connect_to_region(credentials...)
sns.publish(topicArn, message, subject)

这是消息:

Type: <type 'exceptions.ValueError'>
Detail: ('invalid literal for int() with base 10: \'{"default":"216","sqs":"216"}\'',)
4

0 回答 0