Closed rsbh closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
frontier | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Oct 28, 2024 10:01am |
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
internal/api/v1beta1/permission_check.go | 0 | 1 | 0.0% | ||
<!-- | Total: | 0 | 1 | 0.0% | --> |
Files with Coverage Reduction | New Missed Lines | % | ||
---|---|---|---|---|
internal/api/v1beta1/permission_check.go | 1 | 34.13% | ||
<!-- | Total: | 1 | --> |
Totals | |
---|---|
Change from base Build 11516797820: | 0.003% |
Covered Lines: | 7623 |
Relevant Lines: | 24727 |
Problem. If a random ID is passed in the
CheckFederatedResourcePermission
APIresource
body. The API throws anInternal
error. And in the server logs, the error isresource doesn't exist
. After debugging, I found that we fetch the resource from the db, and it returnsErrNotExist
error. This error was not handled in the API handler function.This PR adds a check for the
resource.ErrNotExist
error. It also refactors the switch statement.