Correct logError to log err which has undefined `message`

closes #4384
 - if err is `object` && `err.message` isNOT `string`, let err = `An unknown error occurred.`