In modern law, attempting to commit a crime is criminalized, in some - perhaps many, I'm not sure - legal systems to roughly the same degree as actually committing the attempted crime. However, I've never so far come across a discussion of how someone who, for exampled, tried to kill someone whose blood was illicit to shed but failed to kill him would be punished according to sharia.
To give an example, one could imagine that person A tries to poison person B by inviting B to dinner and placing a poisoned cup of B's favorite beverage at B's place; before B takes a sip, A unintentionally knocks over the cup. In modern law, this would be classified as attempted manslaughter.
Question: is attempting to commit a crime itself criminalized in sharia, and if so, to what degree? E.g. would attempted zina be punished in the same way zina would be punished?
If attempting a crime is punishable, I expect that there will be relatively clear demarcations between attempting a crime and taking preliminary steps that do not yet count as an attempt; if that is the case, please elaborate on that too.