I'm surprised you got that far, when ever I would try on *:error, i never would get anything. I just figured it was some old on event that never worked . Try a period infront of haltdef.
We don't just write the scripts, we put them to the test! (ScriptBusters)
It's quite funny actually, That example never worked for me either when i started a script several years ago, The i saw the example i gave you from a friend, and it's always worked.