And I'd suggest the Custom Dialog offer a reason as to why the calculation can not be done: "Unable to calculate. Field is empty." Or, go further and indicate which field is empty (depending on your User Interface and how much is dependent upon user input, etc.). Cryptic error codes can be very frustrating to users.