TestBuildAPIError_TroubleshooterAbsent pins that Troubleshooter stays empty when the upstream response omits it — wire envelope must omit the field.
(t *testing.T)
| 328 | // TestBuildAPIError_TroubleshooterAbsent pins that Troubleshooter stays empty |
| 329 | // when the upstream response omits it — wire envelope must omit the field. |
| 330 | func TestBuildAPIError_TroubleshooterAbsent(t *testing.T) { |
| 331 | resp := map[string]any{"code": 1470400, "msg": "bad params"} |
| 332 | err := errclass.BuildAPIError(resp, errclass.ClassifyContext{}) |
| 333 | p, ok := errs.ProblemOf(err) |
| 334 | if !ok { |
| 335 | t.Fatal("ProblemOf returned !ok") |
| 336 | } |
| 337 | if p.Troubleshooter != "" { |
| 338 | t.Errorf("Troubleshooter = %q, want empty when resp omits it", p.Troubleshooter) |
| 339 | } |
| 340 | } |
| 341 | |
| 342 | func TestPermissionErrorEnvelopeShape(t *testing.T) { |
| 343 | resp := map[string]any{ |
nothing calls this directly
no test coverage detected