mirror of
https://github.com/hanzoai/metrics.git
synced 2026-10-30 20:03:39 +00:00
* lib/backup/s3remote: update AWS SDK to v2 * Update lib/backup/s3remote/s3.go Co-authored-by: Aliaksandr Valialkin <[email protected]> * lib/backup/s3remote: refactor error handling Co-authored-by: Aliaksandr Valialkin <[email protected]>
23 lines
483 B
Go
23 lines
483 B
Go
package ini
|
|
|
|
import "fmt"
|
|
|
|
// UnableToReadFile is an error indicating that a ini file could not be read
|
|
type UnableToReadFile struct {
|
|
Err error
|
|
}
|
|
|
|
// Error returns an error message and the underlying error message if present
|
|
func (e *UnableToReadFile) Error() string {
|
|
base := "unable to read file"
|
|
if e.Err == nil {
|
|
return base
|
|
}
|
|
return fmt.Sprintf("%s: %v", base, e.Err)
|
|
}
|
|
|
|
// Unwrap returns the underlying error
|
|
func (e *UnableToReadFile) Unwrap() error {
|
|
return e.Err
|
|
}
|