File write should raise if there are any issues, so the final check is redundant and this method could `@return [void]`.