Logging exceptions, returning null. poor code