Retrieve a single application error¶
clsAppError.GetAppError retrieves one error record by its sequence number through the standard BOF single-object retrieve lifecycle. The library provides no application-layer criteria filtering beyond the key — result-count validation happens entirely in AfterRetrieve.
| Field | Value |
|---|---|
| Operation ID | OP-LV-02 |
| Trigger | Caller calls clsAppError.GetAppError(inDataportal, inAppErrorSeqNum) |
| Inputs | IDataPortalInfo, AppErrorSeqNum |
| Outputs | Populated clsAppError object on success; an unhandled ApplicationException("Invalid Results") when the row count is not exactly one |
| Primary components | clsAppError.GetAppError, clsAppError.BeforeRetrieve, clsAppError.AfterRetrieve |
| Entry point | Application\SAIF.Application.LogView\clsAppError.vb |
Steps¶
- Build criteria and dispatch the retrieve.
GetAppErrorconstructs aclsAppError.Criteria(inDataportal, inAppErrorSeqNum)and callsinDataportal.DataAccessLayer.RetrieveObject(...), which drives the BOF retrieve lifecycle. - Configure the retrieve request (
BeforeRetrieve). A data request is built withSQLStatement = MyCriteria.RetrieveSQLand the parameter@AppErrorSeqNumbound from the criteria'sAppErrorSeqNum, targeting App_Error. The single-objectRetrieveSQLproperty onclsAppError.Criteriais a blank (single-space) string in source — there is no executable single-object SELECT statement defined in this library, so the actual retrieval SQL is not documented here.** - Evaluate the result (
AfterRetrieve). - If the result set contains exactly one row: call
Fill(Results(0))to populate every field (DeletedFlag,AppErrorSeqNum,AppName,Environment,ErrorDate,ErrorInfo,ErrorSource,MachineName,PageName,StateInfo,UserName) from the row, thenMarkOld()(BR-005).- On failure: throw
ApplicationException("Invalid Results"). This is an unhandled exception, not a broken-rule collection entry, so the caller must catch it explicitly.
- On failure: throw
- Return the populated object.
AfterRetrievereturnsMe, which the BOF pipeline surfaces back throughGetAppErroras the retrievedclsAppError.
Process flow¶
The following diagram visualizes the single-object retrieve-and-validate flow.
flowchart TD
Start([Caller calls GetAppError]) --> Build[Build Criteria with AppErrorSeqNum]
Build --> Retrieve[BeforeRetrieve: bind @AppErrorSeqNum]
Retrieve --> Exec[Execute retrieve request]
Exec --> Count{Result count = 1?}
Count -->|Yes| Fill[Fill object fields, MarkOld]
Count -->|No| Throw([Throw ApplicationException<br>Invalid Results])
Fill --> Done([Populated clsAppError returned])
Failure and edge-case behavior¶
- The single-object
RetrieveSQLinclsAppError.Criteriais a blank placeholder string, so this retrieve path has no documented executable SQL text in this library; the underlying query behavior cannot be confirmed from source.** - A zero-row match (no such
AppErrorSeqNum) and a multi-row match are both treated identically as anApplicationException("Invalid Results")(BR-005) — the exception message does not distinguish the two cases. - Because the exception is thrown rather than returned as a broken rule, callers must wrap
GetAppErrorin exception handling rather than checkingIsValid.*
Related documentation¶
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¶
Application\SAIF.Application.LogView\clsAppError.vb