Commit 8583feb
Fix wrong-variable logging in signed-URL blob ID encoding catch (#3252)
* Fix wrong-variable logging in signed-URL blob ID encoding catch
The catch in AmbrySecurityService.preProcessRequest's URLEncoder.encode
block declares its parameter as `encodingException` but the log
statement passes `e` — the enclosing lambda's `(r, e) ->` parameter,
which is the result of urlSigningService.verifySignedRequest's callback.
The two are unrelated exceptions: `encodingException` is the actual
URL-encoding failure we just caught; `e` is the signed-URL verification
result.
The bug compiles cleanly because both variables are valid in scope, but
when this fires in production the log message says "Failed to encode
blob id signed url" while the attached stack trace points at the verify
operation — silently misdirecting any operator investigating signed-URL
blob ID encoding failures.
One-character fix: log encodingException instead of e so the message
and the stack trace agree.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Also log outer verifySignedRequest exception at the encoding catch
Per Satish's review on #3252: surface the outer verifySignedRequest
callback exception `e` at the encoding-failure log site too. Plain
separate LOGGER.error line, null-guarded since `e` is null on the
verification-succeeded path.
The primary log (`encodingException`) keeps its accurate "Failed to
encode blob id signed url" message; the secondary log surfaces `e`
with its own message so both stacks are visible alongside each other
in production logs.
No behavior change beyond logging — `callback.onCompletion(r, e)` on
the line below still forwards `e` to the chained failure callback as
before.
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 4700f1a commit 8583feb
1 file changed
Lines changed: 8 additions & 1 deletion
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
127 | 134 | | |
128 | 135 | | |
129 | 136 | | |
| |||
0 commit comments