log error code and message fix #7