Improve logging for error objects that don't have a stack property

Although using strings or plain objects as error types is generally a bad practice in node, the `errorHandler` middleware currently logs `undefined` when it encounters this scenario which isn't really helpful.