DecodeHexTx() checks whether the value is valid hex and whether it can be
fully deserialized as a transaction. It does not explicitly check that vin
is nonempty. If an empty-input transaction does deserialize successfully, it
is rejected later by CheckTransaction() as bad-txns-vin-empty. Some
empty-input serializations can also be ambiguous with the witness marker, but
that is only one possible reason for a decode failure.
Because the same message is returned for all DecodeHexTx() failures, I think
the message should describe the general failure instead of keeping the input
hint.
I would change the message to:
throw JSONRPCError(RPC_DESERIALIZATION_ERROR,
"TX decode failed. Make sure the transaction is complete and correctly serialized "
"as hexadecimal data.");