languagetool-org/languagetool · error · PageNotFoundException
No content found at '" + url + "'
Error message
No content found at '" + url + "'
What it means
Content guard in WikipediaQuickCheck.checkPage: the MediaWiki API response contains no page content for the URL (page missing or empty), so there is nothing to grammar-check; reported via PageNotFoundException semantics.
Source
Thrown at languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java:139
public MarkupAwareWikipediaResult checkPage(URL url) throws IOException, PageNotFoundException {
return checkPage(url, null);
}
/**
* @since 2.6
*/
public MarkupAwareWikipediaResult checkPage(URL url, ErrorMarker errorMarker) throws IOException, PageNotFoundException {
validateWikipediaUrl(url);
String xml = getMediaWikiContent(url);
if (xml.length() > maxSizeBytes) {
throw new RuntimeException("Sorry, the content at " + url + " is too big - this process has been limited to " + maxSizeBytes +
" bytes, but the content is " + xml.length() + " bytes");
}
MediaWikiContent wikiContent = getRevisionContent(xml);
String content = wikiContent.getContent();
if (content.trim().isEmpty()) {
throw new PageNotFoundException("No content found at '" + url + "'");
}
if (content.toLowerCase().contains("#redirect")) {
throw new PageNotFoundException("No content but redirect found at '" + url + "'");
}
return checkWikipediaMarkup(url, wikiContent, getLanguage(url), errorMarker);
}
MarkupAwareWikipediaResult checkWikipediaMarkup(URL url, MediaWikiContent wikiContent, Language language, ErrorMarker errorMarker) throws IOException {
SwebleWikipediaTextFilter filter = new SwebleWikipediaTextFilter();
PlainTextMapping mapping = filter.filter(wikiContent.getContent());
MultiThreadedJLanguageTool lt = getLanguageTool(language);
List<AppliedRuleMatch> appliedMatches = new ArrayList<>();
List<RuleMatch> matches;
try {
matches = lt.check(mapping.getPlainText());
} finally {
lt.shutdown();
}View on GitHub (pinned to 2e990059ce)
Solutions
- Verify the Wikipedia URL points to an existing article
- Handle redirects by following the redirect target
- Treat as a non-existent page in callers instead of a hard failure
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at languagetool-wikipedia/src/main/java/org/languagetool/dev/wikipedia/WikipediaQuickCheck.java:139 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of languagetool-org/languagetool@2e990059ce (2026-09-06).
Data as JSON: /api/errors/05098dcc610e07f7.
Report an issue: GitHub.