mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 22:32:25 -05:00 
			
		
		
		
	[bugfix] Fix domains not being unblockable, log internal server errors from API (#833)
* log internal server errors from 500 api calls * don't exec into nil dest * don't exec into nil dest * log error in router logger not api errorhandling * update logging a tad * linter
This commit is contained in:
		
					parent
					
						
							
								1149310673
							
						
					
				
			
			
				commit
				
					
						c1585d5f8a
					
				
			
		
					 3 changed files with 9 additions and 13 deletions
				
			
		|  | @ -86,6 +86,10 @@ func genericErrorHandler(c *gin.Context, instanceGet func(ctx context.Context, d | |||
| // if something goes wrong during the function, it will recover and just try to serve | ||||
| // an appropriate application/json content-type error. | ||||
| func ErrorHandler(c *gin.Context, errWithCode gtserror.WithCode, instanceGet func(ctx context.Context, domain string) (*apimodel.Instance, gtserror.WithCode)) { | ||||
| 	// set the error on the gin context so that it can be logged | ||||
| 	// in the gin logger middleware (internal/router/logger.go) | ||||
| 	c.Error(errWithCode) //nolint:errcheck | ||||
| 
 | ||||
| 	// discover if we're allowed to serve a nice html error page, | ||||
| 	// or if we should just use a json. Normally we would want to | ||||
| 	// check for a returned error, but if an error occurs here we | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue