mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	[API] on 500 error only show message if gitea in dev mode (#11641)
* add API specific InternalServerError() * return 500 error msg only if not Production mode * rm unnessesary change
This commit is contained in:
		@@ -77,6 +77,10 @@ func (ctx *APIContext) Error(status int, title string, obj interface{}) {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	if status == http.StatusInternalServerError {
 | 
						if status == http.StatusInternalServerError {
 | 
				
			||||||
		log.ErrorWithSkip(1, "%s: %s", title, message)
 | 
							log.ErrorWithSkip(1, "%s: %s", title, message)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
							if macaron.Env == macaron.PROD {
 | 
				
			||||||
 | 
								message = ""
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.JSON(status, APIError{
 | 
						ctx.JSON(status, APIError{
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user