| 
									
										
										
										
											2021-02-04 17:43:36 +01:00
										 |  |  | /// Error that happens within the database module.
 | 
					
						
							| 
									
										
										
										
											2021-02-04 21:47:22 +01:00
										 |  |  | #[derive(thiserror::Error, Debug)]
 | 
					
						
							|  |  |  | pub enum Error {
 | 
					
						
							| 
									
										
										
										
											2021-02-04 17:43:36 +01:00
										 |  |  |     #[error(transparent)]
 | 
					
						
							|  |  |  |     ConnectionError(#[from] diesel::result::ConnectionError),
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #[error(transparent)]
 | 
					
						
							|  |  |  |     MigrationsError(#[from] diesel_migrations::RunMigrationsError),
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     #[error(transparent)]
 | 
					
						
							|  |  |  |     QueryError(#[from] diesel::result::Error),
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-25 22:48:25 +02:00
										 |  |  |     #[error("Missing item dependency ({0} {1})")]
 | 
					
						
							|  |  |  |     MissingItem(&'static str, String),
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-04-25 22:56:16 +02:00
										 |  |  |     #[error("Failed to parse {0} from '{1}'")]
 | 
					
						
							|  |  |  |     ParsingError(&'static str, String),
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-24 15:37:19 +02:00
										 |  |  |     #[error("{0}")]
 | 
					
						
							|  |  |  |     Other(&'static str),
 | 
					
						
							| 
									
										
										
										
											2021-02-04 17:43:36 +01:00
										 |  |  | }
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | /// Return type for database methods.
 | 
					
						
							| 
									
										
										
										
											2021-02-04 21:47:22 +01:00
										 |  |  | pub type Result<T> = std::result::Result<T, Error>;
 |