• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 25040852647

28 Apr 2026 07:53AM UTC coverage: 66.216% (+0.004%) from 66.212%
25040852647

push

github

web-flow
Classify packager errors as 400 in skill build handler (#5076)

* Bump github.com/stacklok/toolhive-core to v0.0.17

v0.0.17 introduces sentinel errors in oci/skills (ErrSkillMDMissing,
ErrInvalidFrontmatter, ErrInvalidSkillDir, ErrInvalidSkillFile,
ErrTooManyFiles, ErrSkillTooLarge) so callers can classify packager
failures with errors.Is instead of matching error strings. Pulled in
ahead of the build-handler refactor that consumes them.

* Classify packager errors as 400 in skill build handler

POST /api/v1beta/skills/build previously surfaced every packager
failure — including user-input mistakes like a missing SKILL.md or a
malformed frontmatter — as 500 Internal Server Error with no body,
generating Sentry noise on what is plainly bad input.

Wrap the s.packager.Package error with an errors.Is switch over the
six toolhive-core v0.0.17 sentinels and map each one to 400 with the
packager's message preserved. Anything else stays a 500.

Add five TestBuild cases that mock the packager returning a wrapped
sentinel and assert both the HTTP code and errors.Is on the sentinel,
covering the limits the toolhive-side validator misses (symlink in
skill dir, oversized dir).

6 of 6 new or added lines in 1 file covered. (100.0%)

7 existing lines in 3 files now uncovered.

59388 of 89688 relevant lines covered (66.22%)

62.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

79.38
/pkg/transport/proxy/httpsse/http_proxy.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc