Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 87209

Summary: Error Messages in CVS ( and normal portage too, but hey )
Product: Portage Development Reporter: Alec Warner <antarus>
Component: CoreAssignee: Portage team <dev-portage>
Status: RESOLVED WONTFIX    
Severity: normal    
Priority: High    
Version: 2.2   
Hardware: All   
OS: All   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: Add more output to error in config.py

Description Alec Warner (RETIRED) archtester gentoo-dev Security 2005-03-29 20:42:30 UTC
This is something I've been meaning to bring up on #-portage lately and that is Portage error messages.  Maybe of them are useful for developers, but not so useful for normal users.  I mean it's great to know that my config_profile_path is broken ( which was the case here, even though I fixed it after a quick look in the code ); most poeple aren't going to grep through the portage source looking for why something happened.

Do you want helpful error messages, or more like a tool/wiki where poeple put in whatever error they got ( Error code N means X is wrote and you need to do Y ).
This leads to flexability in that you don't have to go editing the source all the time to hack error messages.  Portions of the code always return error N and the lookup program just changes the output depending on what the code currently does.  Perhaps a porterr tool or something.  Regardless I'll attach a tiny diff adding ( what I think is helpful anyway ) information for this particular section.  Discussion on error handling in general would be appreciated however.
Comment 1 Alec Warner (RETIRED) archtester gentoo-dev Security 2005-03-29 20:46:33 UTC
Created attachment 54817 [details, diff]
Add more output to error in config.py

in diff -u format.
Comment 2 Jason Stubbs (RETIRED) gentoo-dev 2005-04-11 08:00:36 UTC
That error is meant for developers. It's not something a user should ever see because it's only there to catch deprecated usage of the init function.

As for general error handling, most of it can't be much more specific within portage because the possible causes are too widespread at each context. Most of the errors that portage spits out inline would be far better as exceptions. Callers higher up would generally know the context better and be able to deal with them appropriately. Another stage of the refactoring...