check err is MessageError and func is not nil