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.`
Merge pull request #4384 from meowtec/fix-error-log

fix bug in which `logError` could not resolve an err without `message`