Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(error): improve error log message for not found project id #3507

Merged
merged 2 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion packages/server/modules/shared/authz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,12 @@ export const validateRequiredStreamFactory =
if (!stream)
return authFailed(
context,
new NotFoundError('Stream inputs are malformed'),
new NotFoundError(
'Project ID is malformed and cannot be found, or the project does not exist',
{
info: { projectId: params.streamId }
}
),
true
)
context.stream = stream
Expand Down
8 changes: 7 additions & 1 deletion packages/server/modules/shared/test/authz.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,13 @@ describe('AuthZ @shared', () => {
context: {}
})

expectAuthError(new NotFoundError('Stream inputs are malformed'), authResult)
expectAuthError(
new NotFoundError(
'Project ID is malformed and cannot be found, or the project does not exist',
{ info: { projectId: 'the need for stream' } }
),
authResult
)
})
})
describe('Escape hatches', () => {
Expand Down