SubtitleEdit/subtitleedit · warning · Exception
NameList: Unable to read name list file: {fileNameOrUrl}
Error message
NameList: Unable to read name list file: {fileNameOrUrl} What it means
NameList's loader wraps the entire name-list-file parse (XML fetch, HTTP/HTTPS download, or local file read) in a try/catch and rethrows as a generic Exception with the file name or URL. It signals that the names resource could not be obtained or parsed for a given language, breaking spell-check/name-detection features that depend on it.
Source
Thrown at src/libse/Dictionaries/NameList.cs:181
{
if (reader.Name == "name")
{
var name = reader.ReadElementContentAsString().Trim();
if (name.Length > 0)
{
_blackList.Add(name);
}
}
}
}
}
}
}
}
}
catch (Exception ex)
{
throw new Exception("NameList: Unable to read name list file: " + fileNameOrUrl, ex);
}
}
public bool Remove(string name)
{
name = name.Trim();
if (name.Length > 1 && _namesList.Contains(name) || _namesMultiList.Contains(name))
{
// Try removing name from both lists
_namesList.Remove(name);
_namesMultiList.Remove(name);
_namesMultiListParts = null;
var fileName = GetLocalNamesUserFileName();
var nameListXml = CreateDocument(fileName);
// Add removed name to blacklist
var nameNode = nameListXml.CreateElement("name");View on GitHub (pinned to 17a9f07487)
Solutions
- Ship a local fallback names file and only fetch remote updates opportunistically.
- Catch the exception and degrade gracefully (disable name-based features instead of crashing spell-check).
- Verify the URL/file path is reachable (HEAD request / File.Exists) before parsing.
- Wrap the XML reader in a schema-tolerant parse and skip malformed entries.
Example fix
// before
catch (Exception ex) { throw new Exception("NameList: Unable to read name list file: " + fileNameOrUrl, ex); }
// after
catch (Exception ex)
{
Logger.Warn(ex, $"NameList: failed to load {fileNameOrUrl}; falling back to built-in names.");
LoadBuiltinFallback();
} Defensive patterns
Strategy: fallback
Validate before calling
if (string.IsNullOrEmpty(fileNameOrUrl)) throw new ArgumentException("name list path required");
if (Uri.IsWellFormedUriString(fileNameOrUrl, UriKind.Absolute)) { /* HEAD-check reachable */ }
else if (!File.Exists(fileNameOrUrl)) { /* use built-in fallback */ } Try / catch
try { names = new NameList(fileNameOrUrl); }
catch (Exception ex) when (ex.Message.Contains("name list file")) { names = NameList.BuiltIn; } Prevention
- Ship a built-in names list as a fallback.
- Verify URL reachability / file existence before loading.
- Log and degrade rather than crash spell-check.
When it happens
Trigger: Network failure fetching a remote names XML; HTTP 404/403 for the names URL; malformed XML (unexpected root, missing elements); local file missing or unreadable; encoding mismatch causing the reader to throw.
Common situations: Offline machine trying to fetch remote name lists; outdated URL after a server reorganization; proxy/firewall blocking the request; corrupt local names.xml; locale for which no names file exists.
Related errors
- SeNamesList: Unable to read name list file: {fileNameOrUrl}
- Unable to access bitmap pixel data.
- Too many bytes for CCData!
- Dvd language {code} not found!
- {e.Message}
AI-assisted analysis of SubtitleEdit/subtitleedit@17a9f07487 (2026-08-13).
Data as JSON: /api/errors/8a722068c1394b75.
Report an issue: GitHub.