If it appears on the return that the prisoner is in custody by virtue of civil process of any court legally constituted, or issued by an officer in the course of judicial proceedings before him, authorized by law, such prisoner can only be discharged in one of the following cases:
A. when the jurisdiction of such court or officer has been exceeded either as to matter, place, sum or person; B. where, though the original imprisonment was lawful, yet by some act, omission or event which has taken place afterward, the party is entitled to be discharged; C. where the process is defective in some matter of substance required by law rendering such process void; D. where the process, though in proper form, has been issued in a case not allowed by law; E. where the person having the custody of the prisoner under such process is not the person empowered by law to detain him; or F. where the process is not authorized by any judgment, order or decree of any court, nor by any provision of law. Laws 1884, ch. 1, § 17; C.L. 1884, § 2028; C.L. 1897, § 2797; Code 1915, § 2605; C.S. 1929, § 63-117; 1941 Comp., § 25-1117; 1953 Comp., § 22-11-17.