mirror of
				https://gitea.com/gitea/tea.git
				synced 2025-10-31 01:05:26 +01:00 
			
		
		
		
	Refactor error handling (#308)
use fmt instead of log log.Fatal -> return err set non-zero exit code on error print to default err log cleanup fix vet Co-authored-by: Norwin Roosen <git@nroo.de> Co-authored-by: 6543 <6543@obermui.de> Reviewed-on: https://gitea.com/gitea/tea/pulls/308 Reviewed-by: Lunny Xiao <xiaolunwen@gmail.com> Reviewed-by: 6543 <6543@obermui.de> Co-Authored-By: Norwin <noerw@noreply.gitea.io> Co-Committed-By: Norwin <noerw@noreply.gitea.io>
This commit is contained in:
		| @@ -5,7 +5,7 @@ | ||||
| package repos | ||||
|  | ||||
| import ( | ||||
| 	"log" | ||||
| 	"fmt" | ||||
| 	"strings" | ||||
|  | ||||
| 	"code.gitea.io/tea/cmd/flags" | ||||
| @@ -67,7 +67,7 @@ func runReposSearch(cmd *cli.Context) error { | ||||
| 		if err != nil { | ||||
| 			// HACK: the client does not return a response on 404, so we can't check res.StatusCode | ||||
| 			if err.Error() != "404 Not Found" { | ||||
| 				log.Fatal("could not find owner: ", err) | ||||
| 				return fmt.Errorf("Could not find owner: %s", err) | ||||
| 			} | ||||
|  | ||||
| 			// if owner is no org, its a user | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Norwin
					Norwin