Custom Error Message Not Stopping Transaction

I have had some help getting some custom code to stop adding too much to an op via LaborDtl. The error message comes up, but it doesn’t stop the transaction. How do I change this code to stop the transaction or change it to push out a variable that says true. Then from there I could put in a condition and raise and exception.

if (LaborQty2 > ProductionQty)
{
object THROW_PRIVATE = null;
CallContext.Current.ExceptionManager.AddBLException(“Labor qty would not be more than production qty.”);
THROW_PRIVATE = null;
}