forked from free-lancers/electricity_bill_calc_service
		
	enhance(error):增加两个工具异常。
This commit is contained in:
		
							
								
								
									
										13
									
								
								exceptions/not_found.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								exceptions/not_found.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | package exceptions | ||||||
|  |  | ||||||
|  | type NotFoundError struct { | ||||||
|  | 	Message string | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func NewNotFoundError(msg string) *NotFoundError { | ||||||
|  | 	return &NotFoundError{Message: msg} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (e NotFoundError) Error() string { | ||||||
|  | 	return e.Message | ||||||
|  | } | ||||||
							
								
								
									
										11
									
								
								exceptions/unsuccessful.go
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								exceptions/unsuccessful.go
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,11 @@ | |||||||
|  | package exceptions | ||||||
|  |  | ||||||
|  | type UnsuccessfulOperationError struct{} | ||||||
|  |  | ||||||
|  | func NewUnsuccessfulOperationError() *UnsuccessfulOperationError { | ||||||
|  | 	return &UnsuccessfulOperationError{} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | func (UnsuccessfulOperationError) Error() string { | ||||||
|  | 	return "Unsuccessful Operation" | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user