mirror of
				https://github.com/superseriousbusiness/gotosocial.git
				synced 2025-10-30 15:42:25 -05:00 
			
		
		
		
	[bugfix] Don't return 500 when searching for unpermitted status (#2753)
This commit is contained in:
		
					parent
					
						
							
								459e75a9db
							
						
					
				
			
			
				commit
				
					
						1fe4cdaf46
					
				
			
		
					 1 changed files with 17 additions and 2 deletions
				
			
		|  | @ -491,7 +491,14 @@ func (p *Processor) byURI( | |||
| 		if err != nil { | ||||
| 			// Check for semi-expected error types. | ||||
| 			// On one of these, we can continue. | ||||
| 			if !gtserror.IsUnretrievable(err) && !gtserror.IsWrongType(err) { | ||||
| 			switch { | ||||
| 			case gtserror.IsUnretrievable(err), | ||||
| 				gtserror.IsWrongType(err): | ||||
| 				log.Debugf(ctx, | ||||
| 					"semi-expected error type looking up %s as account: %v", | ||||
| 					uri, err, | ||||
| 				) | ||||
| 			default: | ||||
| 				err = gtserror.Newf("error looking up %s as account: %w", uri, err) | ||||
| 				return gtserror.NewErrorInternalError(err) | ||||
| 			} | ||||
|  | @ -509,7 +516,15 @@ func (p *Processor) byURI( | |||
| 		if err != nil { | ||||
| 			// Check for semi-expected error types. | ||||
| 			// On one of these, we can continue. | ||||
| 			if !gtserror.IsUnretrievable(err) && !gtserror.IsWrongType(err) { | ||||
| 			switch { | ||||
| 			case gtserror.IsUnretrievable(err), | ||||
| 				gtserror.IsWrongType(err), | ||||
| 				gtserror.NotPermitted(err): | ||||
| 				log.Debugf(ctx, | ||||
| 					"semi-expected error type looking up %s as status: %v", | ||||
| 					uri, err, | ||||
| 				) | ||||
| 			default: | ||||
| 				err = gtserror.Newf("error looking up %s as status: %w", uri, err) | ||||
| 				return gtserror.NewErrorInternalError(err) | ||||
| 			} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue