Reverse this check, then it's obvious you're throwing an exception because the file is null, i.e.

if (file == null) {
   throw new FetchException(...)
}

// Do things