---
title: Page error processing
summary: Classifies an unhandled page exception, giving the application first refusal before framework logging/routing takes over.
status: draft
owner: SAIF Doc Gen
last_reviewed: 2026-08-17
library: SAIF.Presentation.Web.MVC
reference_type: package
operation_id: OP-MVC-10
trigger: Page_Error, via ViewPageBase.ProcessError
---

# Page error processing

The entry point for every unhandled exception on a SAIF WebForms page. It lets the application handle its own exceptions first, gives database-availability errors a friendlier on-page message, and otherwise delegates to central logging/notification.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-MVC-10 |
| **Trigger** | `Page_Error` → `ProcessError` |
| **Inputs** | The unhandled exception |
| **Outputs** | Message control text set, navigation to the default view, or delegation to [Central error handling](central-error-handling.md) |
| **Primary components** | `ViewPageBase.ProcessError` |
| **Entry point** | SAIF.Presentation.Web.MVC/ViewPageBase.aspx.vb |

## Steps

1. If no controller exists yet, rethrow the exception — the framework cannot log or route it.
   - On failure: exception propagates to the ASP.NET default error handling (outside this framework's control).
2. Call the overridable `HandleApplicationError(ex)` ([BR-MVC-022](../business-rules.md#br-mvc-022-applications-may-self-handle-exceptions)).
   - If it returns `True`: the application handled the error and processing stops here.
3. If the exception type name is `CLSSAIFEXCEPTION`, read its `SAIFExceptionType` property by reflection.
4. For `TimeOutException`, set the message control to "Database Timeout. Try again." and log via `clsLogError.CreateError`; for `DatabaseNotAvailableException`, set "Database currently unavailable. Try again later." and log ([BR-MVC-023](../business-rules.md#br-mvc-023-database-timeoutunavailable-errors-show-a-retryable-message)).
5. For any other SAIF exception type, delegate to [Central error handling](central-error-handling.md).

> **Origin**: Step 5 delegates to [`Central error handling`](central-error-handling.md) (`clsControllerBase.HandleErrors`, this library) and executed on behalf of this operation.
6. After the SAIF-exception branch, navigate to `Default.aspx?MSG=<message>` in the current application ([BR-MVC-023](../business-rules.md#br-mvc-023-database-timeoutunavailable-errors-show-a-retryable-message)).
   - Embeds [Navigate to a view](navigate-to-view.md) for the redirect itself.
7. For non-SAIF exceptions, delegate directly to [Central error handling](central-error-handling.md).

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
	Start([ProcessError]) --> D0{Controller exists?}
	D0 -->|No| EndRethrow([Rethrow exception])
	D0 -->|Yes| S1[HandleApplicationError override]
	S1 --> D1{Returned True?}
	D1 -->|Yes| EndHandled([Stop - app handled it])
	D1 -->|No| D2{clsSAIFException type?}
	D2 -->|TimeOutException / DatabaseNotAvailableException| S2[Set retry message + log]
	D2 -->|Other SAIF exception| S3[Delegate to HandleErrors]
	D2 -->|Non-SAIF exception| S4[Delegate to HandleErrors]
	S2 --> S5(["Navigate to Default.aspx?MSG=..."])
	S3 --> S5
```

## Failure and edge-case behavior
- Applications that override `HandleApplicationError` can fully suppress framework logging and routing simply by returning `True` — no error is logged in that case.
- Non-SAIF exceptions skip the retryable-message and `Default.aspx` navigation entirely, going straight to central error handling.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)

## Sources
- SAIF.Presentation.Web.MVC/ViewPageBase.aspx.vb
