function namedInWords
namedInWords(message: string): string | null

The same conditions as REFUSALS, recognised from a runtime that reports them only in prose.

Node attaches a code to the cause; Deno attaches nothing and puts one hyper sentence in the message — error sending request for url (…): client error (Connect): tcp connect error: Connection refused (os error 111). That is all true and none of it is worth printing at a prompt, so the condition is read out of the words and said the same way on both.

And the words are the OPERATING SYSTEM's, not Deno's: on Windows the same refusal arrives as No connection could be made because the target machine actively refused it. (os error 10061), which says "refused" without ever saying "connection refused". The Windows sentences are listed beside the Unix ones for that reason.

import { namedInWords } from './remote-inputs.ts';

namedInWords('tcp connect error: Connection refused (os error 111)'); // 'connection refused'
namedInWords('the target machine actively refused it. (os error 10061)'); // 'connection refused'
namedInWords('something nobody has named'); // null

Parameters

message: string

Return Type

string | null

Usage

import { namedInWords } from "lib/setup/remote-inputs.ts";