googleapis / googleapis/google-cloud-java

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

Aperta
#13,054 1 commento 0 reazioni 1 assegnatario Assegnata a @michaelpri10 Vedi su GitHub
api: pubsub type: feature request
Lingua principale
Java
Stelle
2.1k
Fork
1.2k
Merge medio
1g 23h
PR unite (30g)
154

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.