🐛 Abort after error
Fixes https://codeberg.org/danjones000/gin-error-handler/issues/1
This commit is contained in:
		
					parent
					
						
							
								8e8a8079c5
							
						
					
				
			
			
				commit
				
					
						644fbe5fa5
					
				
			
		
					 1 changed files with 2 additions and 0 deletions
				
			
		|  | @ -25,6 +25,8 @@ func HandlerWithErrorWrapper(h HandlerWithError) gin.HandlerFunc { | ||||||
| 	return func(c *gin.Context) { | 	return func(c *gin.Context) { | ||||||
| 		err := h(c) | 		err := h(c) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
|  | 			// We shouldn't process more handlers if there was an error | ||||||
|  | 			c.Abort() | ||||||
| 			c.Error(err) | 			c.Error(err) | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue