When NOT to petition court for habeas corpus?


When is habeas corpus not proper or inapplicable?

[1] For asserting or vindicating denial of right to bail (Enrile vs. Salazar, 186 SCRA 217 [1990])
[2] For correcting errors in appreciation of facts and/or in the application of law. It is not a writ of error. (Sotto vs. Director of Prisons, May 30, 1962).
When can the writ be disallowed?

[1] When the person alleged to be restrained of his liberty is in the custody of an officer under process issued by a court or judge or by virtue of a judgment or order of a court of record and
 the court or judge had jurisdiction to issue the process, render the judgment or make the order, the writ shall not be allowed.
[2] When a person is charged with or convicted of an offense or suffering imprisonment under lawful judgment, his discharge shall not be authorized.