KyleK
Convex Community2y ago
6 replies
Kyle

Mark argument as sensitive to avoid printing it during errors?

Is there a way to mark arguments as sensitive so that when there are errors convex will not print out the variable value in the error messages? For example I pass a "header" arg to some functions which contains an api key that I use to verify a user has permission to run a query/mutation. If something goes wrong though it will print out all the args in plaintext which is not behavior I ever want to be possible for this arg:

[Request ID: yA0NUBpWA99sniqy] Server Error\nArgumentValidationError: Object is missing the required field `namespace`. Consider wrapping the field validator in `v.optional(...)` if this is expected.\n\nObject: {header: \"Bearer rks_(sensitive value)\", key: \"0b2a6bde-698f-4bbe-9740-fb4a3b42c0a9\"}\nValidator: v.object({header: v.string(), namespace: v.string()})\n\n
Was this page helpful?