mirror of
				https://github.com/therootcompany/request.js
				synced 2025-11-03 21:52:46 +00:00 
			
		
		
		
	fix: register otherwise silent http response error
This commit is contained in:
		
							parent
							
								
									bb30d5acf6
								
							
						
					
					
						commit
						3aac42d08b
					
				
							
								
								
									
										3
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								index.js
									
									
									
									
									
								
							@ -120,6 +120,9 @@ function handleResponse(resp, opts, cb) {
 | 
				
			|||||||
        resp.body = '';
 | 
					        resp.body = '';
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    resp._bodyLength = 0;
 | 
					    resp._bodyLength = 0;
 | 
				
			||||||
 | 
					    resp.once('error', function (err) {
 | 
				
			||||||
 | 
					        cb(err, resp, resp.body);
 | 
				
			||||||
 | 
					    });
 | 
				
			||||||
    resp.on('readable', function () {
 | 
					    resp.on('readable', function () {
 | 
				
			||||||
        var chunk;
 | 
					        var chunk;
 | 
				
			||||||
        while ((chunk = resp.read())) {
 | 
					        while ((chunk = resp.read())) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user