nidus-sync/errors.go
Eli Ribble 0614a768c3
Remove redundant API error type, use arcgis
That's what the library is supposed to be for.
Errors still aren't working quite right.
2025-11-14 23:08:26 +00:00

26 lines
516 B
Go

package main
import (
"errors"
"reflect"
"github.com/rs/zerolog/log"
)
func LogErrorTypeInfo(err error) {
if err == nil {
log.Error().Msg("Error is nil")
return
}
// Log current error type
errType := reflect.TypeOf(err)
log.Warn().Err(err).Str("type", errType.String()).Str("pkgPath", errType.PkgPath()).Msg("Error type info")
// Recursively log wrapped errors
wrappedErr := errors.Unwrap(err)
if wrappedErr != nil {
log.Info().Msg("Contains wrapped error")
LogErrorTypeInfo(wrappedErr)
}
}