Made wrapped error accessible
This commit is contained in:
		
							parent
							
								
									35249137c5
								
							
						
					
					
						commit
						ebf3a9aa38
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		
							
								
								
									
										6
									
								
								pkg.go
									
										
									
									
									
								
							
							
						
						
									
										6
									
								
								pkg.go
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -9,7 +9,7 @@ import (
 | 
			
		|||
)
 | 
			
		||||
 | 
			
		||||
type Error struct {
 | 
			
		||||
	err error
 | 
			
		||||
	Wrapped error
 | 
			
		||||
	File string
 | 
			
		||||
	Line int
 | 
			
		||||
	Data interface{}
 | 
			
		||||
| 
						 | 
				
			
			@ -47,7 +47,7 @@ func (wrapped Error) Error() string {
 | 
			
		|||
		"[%s:%d] %s",
 | 
			
		||||
		wrapped.File,
 | 
			
		||||
		wrapped.Line,
 | 
			
		||||
		wrapped.err.Error(),
 | 
			
		||||
		wrapped.Wrapped.Error(),
 | 
			
		||||
	)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -56,7 +56,7 @@ func create(err error, data interface{}) error {
 | 
			
		|||
	file = file[baseDirLength+1:]
 | 
			
		||||
 | 
			
		||||
	wrapped := Error{
 | 
			
		||||
		err: err,
 | 
			
		||||
		Wrapped: err,
 | 
			
		||||
		File: file,
 | 
			
		||||
		Line: line,
 | 
			
		||||
		Data: data,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue