googleapis / googleapis/google-cloud-java

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

オープン
#13,054 コメント 1 件 リアクション 0 件 担当者 1 名 @michaelpri10 に割り当て済み GitHub で見る
api: pubsub type: feature request
主要言語
Java
スター
2.1k
フォーク
1.2k
平均マージ
1日 23時間
マージ済み PR(30日)
154

説明

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);
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。