Better error handling mechanism.