mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Merge pull request #32 from shykes/shykes-0.6.5-dm-plugin
Merge bug fix from dotcloud/docker master
This commit is contained in:
		
						commit
						0c38f86e5e
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		
							
								
								
									
										5
									
								
								api.go
									
										
									
									
									
								
							
							
						
						
									
										5
									
								
								api.go
									
										
									
									
									
								
							| 
						 | 
					@ -61,7 +61,10 @@ func parseMultipartForm(r *http.Request) error {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func httpError(w http.ResponseWriter, err error) {
 | 
					func httpError(w http.ResponseWriter, err error) {
 | 
				
			||||||
	statusCode := http.StatusInternalServerError
 | 
						statusCode := http.StatusInternalServerError
 | 
				
			||||||
	if strings.HasPrefix(err.Error(), "No such") {
 | 
						// FIXME: this is brittle and should not be necessary.
 | 
				
			||||||
 | 
						// If we need to differentiate between different possible error types, we should
 | 
				
			||||||
 | 
						// create appropriate error types with clearly defined meaning.
 | 
				
			||||||
 | 
						if strings.Contains(err.Error(), "No such") {
 | 
				
			||||||
		statusCode = http.StatusNotFound
 | 
							statusCode = http.StatusNotFound
 | 
				
			||||||
	} else if strings.HasPrefix(err.Error(), "Bad parameter") {
 | 
						} else if strings.HasPrefix(err.Error(), "Bad parameter") {
 | 
				
			||||||
		statusCode = http.StatusBadRequest
 | 
							statusCode = http.StatusBadRequest
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue