func FormatError(err error) error {
	if err == nil {
		return nil
	}

	if apiErr, ok := err.(*Error); ok {
		if apiErr.Type == UnauthorizedError {
			for _, m := range apiErr.Err {
				if strings.Contains(m, "wrong identity state: unverified") {
					return NewUnverifiedError()
				}
			}

			return &Error{
				StatusCode: 401,
				Type:       UnauthorizedError,
				Err:        []string{"You are unauthorized to perform this action."},
			}
		}
	}

	return err
}
// FormatError updates an error to contain more context
FormatError updates an error to contain more context
// FormatError updates an error to contain more context
func FormatError(err error) error {
	if err == nil {
		return nil
	}
	if apiErr, ok := err.(*Error); ok {
		if apiErr.Type == UnauthorizedError {
			for _, m := range apiErr.Err {
				if strings.Contains(m, "wrong identity state: unverified") {
					return NewUnverifiedError()
				}
			}
			return &Error{
				StatusCode: 401,
				Type:       UnauthorizedError,
				Err:        []string{"You are unauthorized to perform this action."},
			}
		}
	}
	return err
}
func FormatError ( err error ) error { if err == nil { return nil } if apiErr , ok := err . ( * Error ) ; ok { if apiErr . Type == UnauthorizedError { for _ , m := range apiErr . Err { if strings . Contains ( m , " " ) { return NewUnverifiedError ( ) } } return & Error { StatusCode : 401 , Type : UnauthorizedError , Err : [ ] string { " " } , } } } return err }
FormatError updates an error to contain more context
FormatError updates an error to contain more context