In ancient times, the punishment for officials to deal with crimes is different from ordinary people, the handling of criminal officials is a special institution to operate, under normal circumstances, the official's crimes are indeed found out, he is guilty and in a large case will involve home raids. Such cases are generally more often caused by corrupt officials, and since it is the corrupt official's court that wants to find out his evidence and actual evidence, it will generally be arranged to carry out through home raids. Many corrupt officials, after having embezzled and bribed money, most of them were carefully stored in their own homes, of course, there were also cases of hiding in relatives or friends' homes to escape the raids of the imperial court, but these will eventually be discovered as the case develops. Officials are arrested and imprisoned, and after being found guilty and arranged to raid their homes, their families will also be implicated to a certain extent, if the crime is relatively large, then it is possible that their children and relatives will be sent to the frontier, or they will not enter the official government as slaves and prostitutes. However, in most cases, after raiding the house, the family will generally be given a way to live, and will not be copied too hard. For underage children and others, crimes do not usually affect them. I'll talk about a few things:

Fixed belt for the handling of crimes committed by officials
In ancient times, officials could enjoy some privileges, not only economic and political special treatment, but also for crimes.
For example, during the Western Han Dynasty, Liu Bang, the ancestor of Han Gao, once issued an edict stipulating that officials who committed crimes could enjoy the privileges of "please", "reduce" and "redeem". The "request" is that after an official commits a crime, he cannot directly sentence him in accordance with the law, but must first consult the central government and then sentence according to the instructions. If the official who committed this crime had someone in the middle of the imperial court to say good things or do something to him, then there was a high probability that his crime would be mitigated.
The second is "reduction", that is, after the official commits a crime, the same punishment is also reduced by a certain number of uses, which can be seen when the punishment is executed, and generally the official who commits the crime will not be easily punished.
The last one is "redemption", in other words, the crime of the official can be reduced or exonerated by spending money to redeem it. This situation is also a special treatment for officials, and ordinary people, even if you have money, cannot reduce or exonerate their crimes in this way. Therefore, this situation has also caused some officials in ancient times to like corruption, because they can spend money to settle after committing crimes. However, after the Ming and Qing dynasties, such measures that can redeem one's own crimes are basically gone, but there are still some of the above privileges.
Children of criminal officers are dealt with
In ancient times, the handling of the children of a criminal officer changed with the size of the official's crime, and the general crime only involved the official himself and did not involve his family and children. But if it's some big crime, then his family and children are implicated.
There are mainly the following treatment methods: the first is distribution. That is to say, the family members of the criminal officials are sent to distant frontiers, and in this case, they are generally more fierce and less auspicious. The frontier is far away, and the living conditions are not as good as at home, coupled with the long period of wind, food and sleep are also prone to illness, and many of the children and relatives of prisoners who are distributed in this way have died on the road. The second is to sell to the home of a rich local man as a slave and serve others for a living, such a life is not comfortable, it was originally others who served him, but now it is the other way around, and he has to serve others instead.
Finally, they were assigned to special institutions to serve the officials of the imperial court, which was actually an official brothel in another sense, and only special people could go to places until they died in this institution.
In summary, in ancient times, officials already belonged to the privileged class, and they had a lot of special treatment compared with ordinary people, even if they committed crimes. The treatment of their children after committing their own crimes is related to their own crimes.