Before handling a request, it is important to validate at least some received arguments. A common example of this is arguments related to the PubkyId. By performing validation at this early stage, we can prevent unnecessary database queries. This approach also allows us to provide more meaningful and scoped error messages to the client. For instance, instead of returning the generic User not found, we can explicitly report issues such as Wrong PubkyId format in [argument_name]. This not only improves the accuracy of error reporting but also helps clients correct their requests more easily and reduces wasted processing on the server side
Before handling a request, it is important to validate at least some received arguments. A common example of this is arguments related to the
PubkyId. By performing validation at this early stage, we can prevent unnecessary database queries. This approach also allows us to provide more meaningful and scoped error messages to the client. For instance, instead of returning the generic User not found, we can explicitly report issues such as Wrong PubkyId format in [argument_name]. This not only improves the accuracy of error reporting but also helps clients correct their requests more easily and reduces wasted processing on the server side