sanitize(getFile(getName())?.contents);
Swift requires prefixing the line with try, which makes it easier to notice: try sanitize(getFile(getName()).contents)
Both are a big improvement over exceptions which have no indication at the call site.