Save information about the organization and user from ArcGIS
This commit is contained in:
parent
07d3b3ea76
commit
a08cd87813
20 changed files with 786 additions and 93 deletions
28
errors.go
Normal file
28
errors.go
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"log/slog"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
func LogErrorTypeInfo(err error) {
|
||||
if err == nil {
|
||||
slog.Info("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())
|
||||
|
||||
// Recursively log wrapped errors
|
||||
wrappedErr := errors.Unwrap(err)
|
||||
if wrappedErr != nil {
|
||||
slog.Info("Contains wrapped error")
|
||||
LogErrorTypeInfo(wrappedErr)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue