♻️ Use defined errors
This commit is contained in:
		
					parent
					
						
							
								5b60305de7
							
						
					
				
			
			
				commit
				
					
						2d68691408
					
				
			
		
					 5 changed files with 34 additions and 20 deletions
				
			
		
							
								
								
									
										14
									
								
								models/errors.go
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								models/errors.go
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,14 @@ | |||
| package models | ||||
| 
 | ||||
| import ( | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| ) | ||||
| 
 | ||||
| var ErrorMissingTitle = errors.New("Missing title") | ||||
| var ErrorMissingDate = errors.New("Missing date") | ||||
| var ErrorParsing = errors.New("Parsing Error") | ||||
| 
 | ||||
| func newParsingError(err error) error { | ||||
| 	return fmt.Errorf("%w: %w", ErrorParsing, err) | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue