diff --git a/mews/app.py b/mews/app.py index 4b829dc..4e94615 100644 --- a/mews/app.py +++ b/mews/app.py @@ -137,7 +137,7 @@ def _check(raw_url: str, client: str, listing: bool) -> bytes: if outcome.report is None: return pages.message( - "We couldn't check that page", + "That page couldn't be checked", [outcome.message or "Something went wrong. Try again."], [("/check", "Try again"), ("/spec/0.1", "The spec")], ).encode() diff --git a/mews/check.py b/mews/check.py index 17c7d45..acd5474 100644 --- a/mews/check.py +++ b/mews/check.py @@ -57,8 +57,7 @@ def check_page( return ( None, response, - f"We couldn't read that page (it returned {response.status}). " - "Check the address and try again.", + f"That page returned {response.status}. Check the address and try again.", ) report = validate_bytes( response.body, url=response.url, response=response, fetcher=fetcher @@ -93,7 +92,7 @@ def submit( ) return Outcome( message="This site was taken out of the directory. Write to the " - "address on the about page if that looks wrong." + "address on the home page if that looks wrong." ) limited = db.rate_limited(connection, client=client, domain=domain, listing=listing) @@ -206,7 +205,7 @@ def recheck( try: response = fetcher.get(row["url"], headers=conditional or None) except (UrlError, FetchError): - return _transient(connection, row, "We couldn't reach your site.") + return _transient(connection, row, "Your site didn't answer.") elapsed = int((time.monotonic() - started) * 1000) if response.status == NOT_MODIFIED: @@ -263,7 +262,7 @@ def _transient(connection: sqlite3.Connection, row: sqlite3.Row, note: str) -> s db.remove( connection, row["id"], - f"{note} We tried for {db.TRANSIENT_LIMIT} days.", + f"{note} It stayed that way for {db.TRANSIENT_LIMIT} days.", ) return "fail" return "unreachable" diff --git a/mews/fetch.py b/mews/fetch.py index bf94dc8..27f573c 100644 --- a/mews/fetch.py +++ b/mews/fetch.py @@ -25,7 +25,7 @@ CSS_CAP = 256 * 1024 MAX_REDIRECTS = 3 MAX_URL_LENGTH = 2048 -USER_AGENT = "mews.page checker (+https://mews.page/about)" +USER_AGENT = "mews.page checker (+https://mews.page/)" _PSL = PublicSuffixList() @@ -247,11 +247,11 @@ def resolve(url: str, *, allow_loopback: bool = False) -> str: infos = socket.getaddrinfo(host, port, type=socket.SOCK_STREAM) except socket.gaierror as error: raise FetchError( - "We couldn't find that domain name. Check the address and try again." + "That domain name couldn't be found. Check the address and try again." ) from error addresses = [info[4][0] for info in infos] if not addresses: - raise FetchError("We couldn't find that domain name.") + raise FetchError("That domain name couldn't be found.") for address in addresses: vet_address(address, allow_loopback=allow_loopback) return addresses[0] @@ -356,7 +356,7 @@ class Fetcher: except httpx.TimeoutException as error: raise FetchError("That page took too long to answer.") from error except httpx.HTTPError as error: - raise FetchError("We couldn't connect to that site.") from error + raise FetchError("That site couldn't be reached.") from error return Fetched(url, response.status_code, response.headers, body, truncated) def _read(self, response: httpx.Response, cap: int) -> tuple[bytes, bool]: diff --git a/mews/lint.py b/mews/lint.py index 3db2b44..da2280f 100644 --- a/mews/lint.py +++ b/mews/lint.py @@ -914,8 +914,8 @@ def validate_url( report = Report(url=response.url) report.add( "well-formed", - f"We couldn't read that page (it returned {response.status}). " - "Check the address and try again.", + f"That page returned {response.status}. Check the address " + "and try again.", ) return report return validate_bytes( diff --git a/tests/test_service.py b/tests/test_service.py index 0fc662f..f83755f 100644 --- a/tests/test_service.py +++ b/tests/test_service.py @@ -120,7 +120,7 @@ def test_an_address_that_is_not_a_page_is_refused(service): def test_an_unreachable_page_is_reported(service, site): _, body = post(site.base + "/missing.html", listing=True) - assert "it returned 404" in body + assert "That page returned 404" in body def test_resubmitting_a_site_updates_the_same_row(