Add some log information on error to detect the error type