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:
@@ -33,7 +33,12 @@ export const languageProcedure = baseProcedure.use(async function (opts) {
|
|||||||
const parsedInput = langInput.safeParse(input)
|
const parsedInput = langInput.safeParse(input)
|
||||||
|
|
||||||
if (process.env.NODE_ENV === "development" && !parsedInput.success) {
|
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({
|
return opts.next({
|
||||||
|
|||||||
Reference in New Issue
Block a user