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