mirror of
				https://git.coolaj86.com/coolaj86/request.js
				synced 2025-11-03 18:42:48 +00:00 
			
		
		
		
	use callback not throw
This commit is contained in:
		
							parent
							
								
									28e67055e7
								
							
						
					
					
						commit
						94eec37646
					
				
							
								
								
									
										3
									
								
								index.js
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								index.js
									
									
									
									
									
								
							@ -186,7 +186,8 @@ function setDefaults(defs) {
 | 
			
		||||
      debug(finalOpts);
 | 
			
		||||
      req = http.request(finalOpts, onResponse);
 | 
			
		||||
    } else {
 | 
			
		||||
      throw new Error("unknown protocol: '" + opts.uri.protocol + "'");
 | 
			
		||||
      cb(new Error("unknown protocol: '" + opts.uri.protocol + "'"));
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    req.on('error', function (e) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user