Remove redundant API error type, use arcgis

That's what the library is supposed to be for.
Errors still aren't working quite right.
This commit is contained in:
Eli Ribble 2025-11-14 23:08:26 +00:00
parent e48abb09c0
commit 0614a768c3
No known key found for this signature in database
3 changed files with 22 additions and 28 deletions

View file

@ -2,27 +2,25 @@ package main
import (
"errors"
"log/slog"
"reflect"
"github.com/rs/zerolog/log"
)
func LogErrorTypeInfo(err error) {
if err == nil {
slog.Info("Error is nil")
log.Error().Msg("Error is nil")
return
}
// Log current error type
errType := reflect.TypeOf(err)
slog.Info("Error type info",
"type", errType.String(),
"pkgPath", errType.PkgPath(),
"error", err.Error())
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 {
slog.Info("Contains wrapped error")
log.Info().Msg("Contains wrapped error")
LogErrorTypeInfo(wrappedErr)
}
}