googleapis / googleapis/google-cloud-java

[java-pubsub] TopicName.parse could throw a more detailed ValidationException

Đang mở
#13,054 1 bình luận 0 reaction 1 người được giao Được giao cho @michaelpri10 Xem trên GitHub
api: pubsub type: feature request
Ngôn ngữ chính
Java
Star
2.1k
Fork
1.2k
Merge trung bình
1 ngày 23 giờ
Pull request đã merge (30 ngày)
154

Mô tả

Recently I faced an issue when using the `Topic.parse(String formattedString)` method, because the String being used was an environment variable defined within a pod.
I could've been faster in resolving the issue, if the `formattedString` originating from the environment variable would be printed out as part of the ValidationException's message.

Also see my PR for this minor improvement: https://github.com/googleapis/java-pubsub/pull/1505

Current behavior:

The message `TopicName.parse: formattedString not in valid format` is shown.

```java
throw new ValidationException("TopicName.parse: formattedString not in valid format");
```

Expected / desired behavior:

The message `TopicName.parse: formattedString (${actual value of formattedString}) not in valid format` is shown.

```java
throw new ValidationException(
"TopicName.parse: formattedString (%s) not in valid format", formattedString);
```

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.