fetch.js
function fetchText(address, contentType) {
    return get(address, contentType)
        .then(streamToText)
        .catch(err => {
            console.error(`Fetch error: ${err.message}`);
            throw err; // re-throw
        });
}
function fetchText(address, contentType) {
    return get(address, contentType)
        .then(streamToText)
        .catch(err => {
            console.error(`Fetch error: ${err.message}`);
            throw err; // re-throw
        });
}
function fetchText ( address , contentType ) { return get ( address , contentType ) . then ( streamToText ) . catch ( err => { console . error ( ` ${ err . message } ` ) ; throw err ; // re-throw } ) ; }
Fetches text from the given address.
Rejects if received text is larger than MAX_TEXT_LENGTH.

@param {string} address source URL
@param {string?} [contentType] expected content type or undefined if any
@returns {Promise<string>} resulting text
Fetches text from the given address . Rejects if received text is larger than MAX_TEXT_LENGTH .