Throw exception on invalid method call