Throwing exceptions when a method or function does not exist