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 |
| Primary components | ViewPageBase.ProcessError |
| Entry point | SAIF.Presentation.Web.MVC/ViewPageBase.aspx.vb |
Steps¶
- 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).
- Call the overridable
HandleApplicationError(ex)(BR-MVC-022). - If it returns
True: the application handled the error and processing stops here. - If the exception type name is
CLSSAIFEXCEPTION, read itsSAIFExceptionTypeproperty by reflection. - For
TimeOutException, set the message control to "Database Timeout. Try again." and log viaclsLogError.CreateError; forDatabaseNotAvailableException, set "Database currently unavailable. Try again later." and log (BR-MVC-023). - For any other SAIF exception type, delegate to Central error handling.
Origin: Step 5 delegates to
Central error handling(clsControllerBase.HandleErrors, this library) and executed on behalf of this operation. 6. After the SAIF-exception branch, navigate toDefault.aspx?MSG=<message>in the current application (BR-MVC-023). - Embeds Navigate to a view for the redirect itself. 7. For non-SAIF exceptions, delegate directly to Central error handling.
Process flow¶
The following diagram visualizes this operation's control flow.
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
HandleApplicationErrorcan fully suppress framework logging and routing simply by returningTrue— no error is logged in that case. - Non-SAIF exceptions skip the retryable-message and
Default.aspxnavigation entirely, going straight to central error handling.
Related documentation¶
Sources¶
- SAIF.Presentation.Web.MVC/ViewPageBase.aspx.vb