Use the error as the first argument of the logger

This reflects the changes of 08efe3c.