---
title: ErrorInfoStruct
summary: API reference for ErrorInfoStruct.
status: draft
owner: <owner>
last_reviewed: 2026-07-23
library: SAIF.Framework.Logging
reference_type: package
---

# ErrorInfoStruct

`ErrorInfoStruct` is a `Serializable` value type used to pass exception and context data between [clsLogError](clsLogError.md), the local CSV file sink, and the remote `wsLogging` SOAP web service.

## Purpose
- Carry ambient context (application name, machine name, environment, page name, username) and captured exception detail (`ExceptionInfo`, `ExceptionSource`, `StateInfo`) for a single error-log record.
- Provide CSV (`CSVHeader`/`ToCSVString`), HTML (`ToHTMLString`), and plain-text (`ToString`) rendering used respectively by the local file sink, email-notification body, and general display.

## Context
- Namespace: `SAIF.Framework.Logging`
- Assembly/package: `SAIF.BOF.Framework.Logging` (`SAIF.Framework.Logging/SAIF.BOF.Framework.Logging.vbproj`)
- Declared `<Serializable()> Public Structure ErrorInfoStruct`, allowing it to be marshalled to the `wsLogging` SOAP web service.
- Imports `SAIF.Framework.Logging.clsLogCommon` to use its `STATEFMTSIMPLE` format constant in `ToString`/`ToHTMLString`.

## Public members
| Member | Signature | Purpose |
| --- | --- | --- |
| `ApplicationName` | `Public ApplicationName As String` | Name of the hosting application that produced the error. |
| `Environment` | `Public Environment As String` | Deployment environment name derived for the hosting application. |
| `ErrorDate` | `Public ErrorDate As DateTime` | Timestamp of the error event. |
| `ExceptionInfo` | `Public ExceptionInfo As String` | Recursively formatted exception message/source/stack-trace detail (innermost exception first). |
| `ExceptionSource` | `Public ExceptionSource As String` | Source of the outermost captured exception. |
| `MachineName` | `Public MachineName As String` | Name of the machine on which the error occurred. |
| `PageName` | `Public PageName As String` | Name of the page (web) or calling context associated with the error. |
| `StateInfo` | `Public StateInfo As String` | Rendered caller-supplied state data (via `clsLogCommon.GetStateInfo`), included for diagnostic context. |
| `Username` | `Public Username As String` | Name of the current user associated with the error. |
| `CSVHeader` | `Public Shared Function CSVHeader() As String` | Returns the fixed CSV column-header row used by the local file sink. |
| `ToCSVString` | `Public Function ToCSVString() As String` | Renders the struct's field values as a single CSV row. |
| `ToHTMLString` | `Public Function ToHTMLString() As String` | Renders the struct as an HTML fragment (bordered `<div>` sections), used for email-notification bodies. |
| `ToString` | `Public Overrides Function ToString() As String` | Renders the struct's field values as a formatted plain-text block using `clsLogCommon.STATEFMTSIMPLE`. |

## Behavioral notes
- Populated by `clsLogError`'s constructor / `GetBasicErrorInfo()` context-gathering logic, including recursive inner-exception formatting via `ExceptionToString`, before being passed to `WriteMessage` for dispatch*.
- Marshalled as-is to the `wsLogging.clsWSLogging.WriteError` SOAP operation when the remote sink (default) is used.
- `ToHTMLString` is used to build the body of error-notification emails sent by `clsLogError.CreateErrorWithEmail` (see [BR-006](../../business-rules.md#br-006-email-error-notification-always-sent-to-a-fixed-corporate-email-domain)).

## Constraints and usage notes
- `ToString`/`ToHTMLString`/`ToCSVString` are the only rendering entry points; there is no way to obtain a structured (non-string) view of the captured exception detail beyond the raw `ExceptionInfo`/`ExceptionSource` fields.

> **Note:** Statements marked with `*` were inferred from code structure, naming conventions, or
> contextual evidence where direct confirmation was not available in source artifacts. Statements
> marked with `**` could not be confirmed; treat as unknown until verified.

## Sources
- `SAIF.Framework.Logging/ErrorInfoStruct.vb`
- `SAIF.Framework.Logging/clsLogCommon.vb`
