Rename all caught exception variables to "exc", not "e".
This commit is contained in:
		
							parent
							
								
									7f410f1da5
								
							
						
					
					
						commit
						a7cc6d2383
					
				
					 2 changed files with 5 additions and 5 deletions
				
			
		|  | @ -143,9 +143,9 @@ def normalize_author(authors, photodb, warning_bag=None): | |||
| 
 | ||||
|         try: | ||||
|             user = photodb.get_user(username=requested_author) | ||||
|         except exceptions.NoSuchUser as e: | ||||
|         except exceptions.NoSuchUser as exc: | ||||
|             if warning_bag: | ||||
|                 warning_bag.add(e.error_message) | ||||
|                 warning_bag.add(exc.error_message) | ||||
|             else: | ||||
|                 raise | ||||
|         else: | ||||
|  |  | |||
|  | @ -16,12 +16,12 @@ def catch_etiquette_exception(function): | |||
|     def wrapped(*args, **kwargs): | ||||
|         try: | ||||
|             return function(*args, **kwargs) | ||||
|         except etiquette.exceptions.EtiquetteException as e: | ||||
|             if isinstance(e, etiquette.exceptions.NoSuch): | ||||
|         except etiquette.exceptions.EtiquetteException as exc: | ||||
|             if isinstance(exc, etiquette.exceptions.NoSuch): | ||||
|                 status = 404 | ||||
|             else: | ||||
|                 status = 400 | ||||
|             response = etiquette.jsonify.exception(e) | ||||
|             response = etiquette.jsonify.exception(exc) | ||||
|             response = jsonify.make_json_response(response, status=status) | ||||
|             flask.abort(response) | ||||
|     return wrapped | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue