Commits

Anonymous committed 891f32e

Renamed AppRequestError to RequestAppError,
HostRequestError to RequestHostError.

  • Participants
  • Parent commits a80a95b

Comments (0)

Files changed (1)

                              request.data || '');
   var endOfHead = raw.indexOf('\n\n');
   if (endOfHead == -1)
-    throw exports.AppRequestError('Response without a head');
+    throw exports.RequestAppError('Response without a head');
   var content = raw.range(endOfHead + 2);
   var headerLines = raw.range(0, endOfHead).toString().split('\n');
   var statusString = headerLines.shift();
   var status = +statusString;
   if (!status)
-    throw exports.AppRequestError('Invalid status: "' + statusString + '"');
+    throw exports.RequestAppError('Invalid status: "' + statusString + '"');
   var headers = {};
   headerLines.forEach(
     function (headerLine) {
       var name = headerLine.split(': ', 1)[0];
       if (name.length == headerLine.length)
-        throw exports.AppRequestError(
+        throw exports.RequestAppError(
           'Invalid header line: "' + headerLine + '"');
       headers[name] = headerLine.substr(name.length + 2);
     });
 
   var endOfHead = raw.indexOf('\r\n\r\n');
   if (endOfHead == -1)
-    throw exports.HostRequestError('Unexpected end of response');
+    throw exports.RequestHostError('Unexpected end of response');
   var content = raw.range(endOfHead + 4);
   var responseHeaderLines = raw.range(0, endOfHead).toString().split('\r\n');
   var match = responseHeaderLines.shift().match(/^http\/[^ ]+ ([0-9]+).*$/i);
   if (!match)
-    throw exports.HostRequestError('Illegal HTTP response status line');
+    throw exports.RequestHostError('Illegal HTTP response status line');
   var status = +match[1];
   var responseHeaders = {};
   var prev;