googleapis / googleapis/google-cloud-java

[java-storage-nio] Improve error messages in StorageExceptions

未关闭
#12,555 3 条评论 0 个 reaction 已指派 1 人 已被 @BenWhitehead 认领 在 GitHub 查看
api: storage priority: p3 type: feature request
主要语言
Java
星标
2.1k
派生
1.2k
平均合并
1 天 23 小时
30 天内合并 PR
154

描述

I know that the messages in StorageExceptions come from some storage service that isn't part of this project, but I'm not sure where to make this request otherwise.

**Is your feature request related to a problem? Please describe.**
StorageExceptions are always extremely vague about the exact details of what caused the problem. They don't include the specific strings that were invalid. This can make debugging tricky when there are multiple potential connections that could have failed, or if something in the user code that generates a Path is generating incorrect ones.

For example, they'll include information like the following:
```
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "The specified bucket does not exist.",
"reason" : "notFound"
}
```
It would be much more useful if in this case they included what the bucket name was.

**Describe the solution you'd like**
Include the specific problem in the message.
For instance if the bad bucket name was "bucketImisspelled"
```
{
"code" : 404,
"errors" : [ {
"domain" : "global",
"message" : "The specified bucket does not exist. (bucketImisspelled)"
"reason" : "notFound"
} ],
```
**Describe alternatives you've considered**
Other options would be to include an additional "details" field if the message has to always be the same.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。