Can you force the return of a handler when defining a custom query?
convex-helpers to define a customQuery, is it possible to force the return of the handler? All the examples throw when there is, for example, an authentication issue.Instead I'd like to have a
type Result<T> = {success: true, data: T} | {success: false, code: number, message: string} that all queries return, and then when there is an authentication issue force the handler to return {success: false, code: 401, message: "Invalid authentication."}.I'm looking at this: https://stack.convex.dev/custom-functions, which recommends using throws like this:
