mirror of
				https://github.com/simon987/Architeuthis.git
				synced 2025-11-04 07:56:52 +00:00 
			
		
		
		
	return response even on error (WIP)
This commit is contained in:
		
							parent
							
								
									dfa66c9533
								
							
						
					
					
						commit
						3008ab5843
					
				
							
								
								
									
										6
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								main.go
									
									
									
									
									
								
							@ -35,8 +35,12 @@ func New() *Architeuthis {
 | 
			
		||||
 | 
			
		||||
			if err != nil {
 | 
			
		||||
				logrus.WithError(err).Trace("Could not complete request")
 | 
			
		||||
				if resp != nil {
 | 
			
		||||
					return nil, resp
 | 
			
		||||
				} else {
 | 
			
		||||
					return nil, goproxy.NewResponse(r, "text/plain", http.StatusInternalServerError, err.Error())
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			return nil, resp
 | 
			
		||||
		})
 | 
			
		||||
@ -115,7 +119,7 @@ func (a *Architeuthis) processRequest(r *http.Request) (*http.Response, error) {
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		if !responseCtx.ShouldRetry {
 | 
			
		||||
			return nil, responseCtx.Error
 | 
			
		||||
			return responseCtx.Response, responseCtx.Error
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user