mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	Restore friendly error messages
Use --verbose if you really want a full traceback with your 'you made a typo in an package ID' messages. It would be better to do this based on exception types (i.e. our own exceptions - MetadataException, BuildException, VCSException) would not print a traceback, but unexpected exceptions would. But the types are not available at the 'fdroid' level currently.
This commit is contained in:
		
							parent
							
								
									6391f204e1
								
							
						
					
					
						commit
						e29da6b023
					
				
					 3 changed files with 12 additions and 4 deletions
				
			
		
							
								
								
									
										9
									
								
								fdroid
									
										
									
									
									
								
							
							
						
						
									
										9
									
								
								fdroid
									
										
									
									
									
								
							| 
						 | 
					@ -83,7 +83,14 @@ def main():
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    del sys.argv[1]
 | 
					    del sys.argv[1]
 | 
				
			||||||
    mod = __import__('fdroidserver.' + command, None, None, [command])
 | 
					    mod = __import__('fdroidserver.' + command, None, None, [command])
 | 
				
			||||||
    mod.main()
 | 
					    try:
 | 
				
			||||||
 | 
					        mod.main()
 | 
				
			||||||
 | 
					    except Exception, e:
 | 
				
			||||||
 | 
					        if verbose:
 | 
				
			||||||
 | 
					            raise
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            print str(e)
 | 
				
			||||||
 | 
					        sys.exit(1)
 | 
				
			||||||
    sys.exit(0)
 | 
					    sys.exit(0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if __name__ == "__main__":
 | 
					if __name__ == "__main__":
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -907,7 +907,7 @@ class BuildException(Exception):
 | 
				
			||||||
        return ret
 | 
					        return ret
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        ret = repr(self.value)
 | 
					        ret = self.value
 | 
				
			||||||
        if self.detail:
 | 
					        if self.detail:
 | 
				
			||||||
            ret += "\n==== detail begin ====\n%s\n==== detail end ====" % self.detail.strip()
 | 
					            ret += "\n==== detail begin ====\n%s\n==== detail end ====" % self.detail.strip()
 | 
				
			||||||
        return ret
 | 
					        return ret
 | 
				
			||||||
| 
						 | 
					@ -918,7 +918,7 @@ class VCSException(Exception):
 | 
				
			||||||
        self.value = value
 | 
					        self.value = value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        return repr(self.value)
 | 
					        return self.value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Get the specified source library.
 | 
					# Get the specified source library.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -23,13 +23,14 @@ import glob
 | 
				
			||||||
import cgi
 | 
					import cgi
 | 
				
			||||||
import logging
 | 
					import logging
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					srclibs = []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class MetaDataException(Exception):
 | 
					class MetaDataException(Exception):
 | 
				
			||||||
    def __init__(self, value):
 | 
					    def __init__(self, value):
 | 
				
			||||||
        self.value = value
 | 
					        self.value = value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def __str__(self):
 | 
					    def __str__(self):
 | 
				
			||||||
        return repr(self.value)
 | 
					        return self.value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
app_defaults = {
 | 
					app_defaults = {
 | 
				
			||||||
    'Name': None,
 | 
					    'Name': None,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue