Merged in fix/include-info-when-missingLangInTRPC (pull request #2890)

* chore: include more info when we get missing lang in tRPC context


Approved-by: Linus Flood
This commit is contained in:
Joakim Jäderberg
2025-10-01 11:43:12 +00:00
parent df8e223d23
commit 764e7cf49a

View File

@@ -33,7 +33,12 @@ export const languageProcedure = baseProcedure.use(async function (opts) {
const parsedInput = langInput.safeParse(input)
if (process.env.NODE_ENV === "development" && !parsedInput.success) {
throw badRequestError("Missing Lang in tRPC context")
throw badRequestError({
message: "Missing lang in tRPC context",
path: opts.path,
type: opts.type,
input: opts.input,
})
}
return opts.next({