Skip to content
Snippets Groups Projects

Resolve "Some of the used errors do not provide useful information"

12 files
+ 52
46
Compare changes
  • Side-by-side
  • Inline
Files
12
@@ -174,11 +174,13 @@ func (e ErrCouldNotMarshall) Error() string {
@@ -174,11 +174,13 @@ func (e ErrCouldNotMarshall) Error() string {
// ErrCouldNotUpdate implements the Error interface and is called if a
// ErrCouldNotUpdate implements the Error interface and is called if a
// stored item can not be updated.
// stored item can not be updated.
type ErrCouldNotUpdate struct {
type ErrCouldNotUpdate struct {
StoreName string
Identifier any
 
Type any
 
Err error
}
}
func (e ErrCouldNotUpdate) Error() string {
func (e ErrCouldNotUpdate) Error() string {
return fmt.Sprintf("could not update %s", e.StoreName)
return fmt.Sprintf("could not update Identifier: %v of Type: %T, Internal error: %v", e.Identifier, e.Type, e.Err)
}
}
// ErrCouldNotFind implements the Error interface and is called if a
// ErrCouldNotFind implements the Error interface and is called if a
@@ -195,21 +197,25 @@ func (e ErrCouldNotFind) Error() string {
@@ -195,21 +197,25 @@ func (e ErrCouldNotFind) Error() string {
// ErrCouldNotCreate implements the Error interface and is called if a
// ErrCouldNotCreate implements the Error interface and is called if a
// stored item can not be found.
// stored item can not be found.
type ErrCouldNotCreate struct {
type ErrCouldNotCreate struct {
StoreName string
Identifier any
 
Type any
 
Err error
}
}
func (e ErrCouldNotCreate) Error() string {
func (e ErrCouldNotCreate) Error() string {
return fmt.Sprintf("could not create %s", e.StoreName)
return fmt.Sprintf("could not create Identifier: %v of Type: %T, Internal error: %v", e.Identifier, e.Type, e.Err)
}
}
// ErrCouldNotDelete implements the Error interface and is called if a
// ErrCouldNotDelete implements the Error interface and is called if a
// stored item can not be deleted.
// stored item can not be deleted.
type ErrCouldNotDelete struct {
type ErrCouldNotDelete struct {
StoreName string
Identifier any
 
Type any
 
Err error
}
}
func (e ErrCouldNotDelete) Error() string {
func (e ErrCouldNotDelete) Error() string {
return fmt.Sprintf("could not delete %s", e.StoreName)
return fmt.Sprintf("could not delete Identifier: %v of Type: %T, Internal error: %v", e.Identifier, e.Type, e.Err)
}
}
// ErrNoNewChanges implements the Error interface and is called if a the
// ErrNoNewChanges implements the Error interface and is called if a the
Loading