Skip to content

Fix string interpolation in Timestamp error message#26270

Closed
04cb wants to merge 2 commits into
protocolbuffers:mainfrom
04cb:fix/timestamp-error-message-formatting
Closed

Fix string interpolation in Timestamp error message#26270
04cb wants to merge 2 commits into
protocolbuffers:mainfrom
04cb:fix/timestamp-error-message-formatting

Conversation

@04cb

@04cb 04cb commented Mar 8, 2026

Copy link
Copy Markdown

Fixes #26006. Changed @ to $ for string interpolation so the error message displays actual values for Seconds and Nanos instead of literal placeholders.

@04cb
04cb requested a review from a team as a code owner March 8, 2026 02:29
@04cb
04cb requested review from jskeet and removed request for a team March 8, 2026 02:29

@jskeet jskeet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, that's embarrassing. Would you be happy to adjust the test (csharp/src/Google.Protobuf.Test/WellKnownTypes/TimestampTest.cs line 46) as well? (Possibly just check that the message contains the string values of both seconds and nanoseconds, rather than asserting an exact message?)

@jskeet jskeet left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks.

@jskeet
jskeet requested a review from mkruskal-google March 8, 2026 15:05
@jskeet

jskeet commented Mar 8, 2026

Copy link
Copy Markdown
Contributor

(Adding Mike to merge if he's happy.)

@mkruskal-google mkruskal-google added the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 8, 2026
@github-actions github-actions Bot removed the 🅰️ safe for tests Mark a commit as safe to run presubmits over label Mar 8, 2026
@04cb 04cb closed this by deleting the head repository Mar 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Timestamp.ToDateTime() is not formatting the error message

3 participants