[pkgsite] internal/api: avoid leaking internal parsing errors

0 views
Skip to first unread message

Gopher Robot (Gerrit)

unread,
May 11, 2026, 1:02:32 PM (11 hours ago) May 11
to Ethan Lee, goph...@pubsubhelper.golang.org, golang-...@googlegroups.com, kokoro, golang...@luci-project-accounts.iam.gserviceaccount.com, Hyang-Ah Hana Kim, Jonathan Amsterdam, golang-co...@googlegroups.com

Gopher Robot submitted the change with unreviewed changes

Unreviewed changes

2 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: internal/api/params.go
Insertions: 1, Deletions: 1.

@@ -201,7 +201,7 @@
}
iv, err := strconv.ParseInt(val, 10, field.Type().Bits())
if err != nil {
- return fmt.Errorf("invalid value %q for %s", val, tag)
+ return fmt.Errorf("invalid integer value %q for %s", val, tag)
}
field.SetInt(iv)
case reflect.Bool:
```

Change information

Commit message:
internal/api: avoid leaking internal parsing errors

Avoid leaking internal errors such as the following:
{"code":400,"message":"invalid value \"abc\" for limit: strconv.ParseInt: parsing \"abc\": invalid syntax"}
Change-Id: Id5c6e6a86e0b079d86c555923f8d765abdaac271
Reviewed-by: Hyang-Ah Hana Kim <hya...@gmail.com>
kokoro-CI: kokoro <noreply...@google.com>
Reviewed-by: Jonathan Amsterdam <j...@google.com>
Auto-Submit: Ethan Lee <etha...@google.com>
Files:
  • M internal/api/params.go
  • M internal/tests/api/api_test.go
Change size: XS
Delta: 2 files changed, 3 insertions(+), 3 deletions(-)
Branch: refs/heads/master
Submit Requirements:
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: pkgsite
Gerrit-Branch: master
Gerrit-Change-Id: Id5c6e6a86e0b079d86c555923f8d765abdaac271
Gerrit-Change-Number: 775625
Gerrit-PatchSet: 4
Gerrit-Owner: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Ethan Lee <etha...@google.com>
Gerrit-Reviewer: Gopher Robot <go...@golang.org>
Gerrit-Reviewer: Hyang-Ah Hana Kim <hya...@gmail.com>
Gerrit-Reviewer: Jonathan Amsterdam <j...@google.com>
Gerrit-Reviewer: kokoro <noreply...@google.com>
Gerrit-CC: kokoro <noreply...@google.com>
open
diffy
satisfied_requirement
Reply all
Reply to author
Forward
0 new messages