Skip to content

Exceptions created by FlowController don't provide getMessage method implementations #12950

Description

@mkuthan

Standard Java convention for exception messages is:

  • getMessage() → returns the raw detail message
  • toString() → returns ClassName: getMessage()

FlowController creates exceptions without implementing getMessage() or calling super(msg) in its constructors. Consequently, getMessage() returns null.

When logging framework uses getMessage() to render the output you will get very limited text representation.
For example:

com.google.api.gax.batching.FlowController$MaxOutstandingRequestBytesReachedException: null
	at com.google.cloud.pubsub.v1.Publisher$MessageFlowController.acquire(Publisher.java:1019)
	at com.google.cloud.pubsub.v1.Publisher.publish(Publisher.java:297)

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: p3Desirable enhancement or fix. May not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions