mirror of
				https://github.com/krateng/maloja.git
				synced 2023-08-10 21:12:55 +03:00 
			
		
		
		
	Added exceptions to database
This commit is contained in:
		| @@ -47,6 +47,14 @@ errors = { | ||||
| 			'desc':"A scrobble requires these parameters." | ||||
| 		} | ||||
| 	}), | ||||
| 	database.exceptions.EntityExists: lambda e: (409,{ | ||||
| 		"status":"failure", | ||||
| 		"error":{ | ||||
| 			'type':'entity_exists', | ||||
| 			'value':e.entitydict, | ||||
| 			'desc':"This entity already exists in the database." | ||||
| 		} | ||||
| 	}), | ||||
| 	Exception: lambda e: (500,{ | ||||
| 		"status":"failure", | ||||
| 		"error":{ | ||||
|   | ||||
							
								
								
									
										10
									
								
								maloja/database/exceptions.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								maloja/database/exceptions.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| class EntityExists(Exception): | ||||
| 	def __init__(self,entitydict): | ||||
| 		self.entitydict = entitydict | ||||
|  | ||||
|  | ||||
| class TrackExists(EntityExists): | ||||
| 	pass | ||||
|  | ||||
| class ArtistExists(EntityExists): | ||||
| 	pass | ||||
		Reference in New Issue
	
	Block a user
	 krateng
					krateng