Central error handling¶
The terminal error-handling operation for every SAIF WebForms screen: it logs the error with model/context detail, e-mails the support distribution list, and redirects the browser to an environment-appropriate error page with a sanitized message.
| Field | Value |
|---|---|
| Operation ID | OP-MVC-11 |
| Trigger | Delegated from Page error processing, or called directly |
| Inputs | Exception, model, context |
| Outputs | Logged/e-mailed error; redirect to the error page with an encoded message |
| Primary components | clsControllerBase.HandleErrors |
| Entry point | SAIF.Presentation.Web.MVC/clsControllerBase.vb |
Steps¶
- Read the support distribution list from
EnvironmentService.GetConfigSetting("policymanagement.supportemaillist")(BR-MVC-024). - If the setting is missing: the value is passed through as-is with no guard, which can turn a handled error into a secondary failure inside the error handler.*
- Call
clsLogError.CreateErrorWithEmail(smTo, ex, model, context)— logs the error and e-mails support with model/context detail (BR-MVC-024). - Resolve the error page from
AppSettings("ErrorPageName")(BR-MVC-025). - If absent: choose
http://saifonline/weberror/processerror.aspxfor internal callers (10.*.*.*) orhttps://saifonline.saif.com/weberror/processerror.aspxotherwise. - HTML-encode the exception message and strip CR/LF characters (BR-MVC-026).
- Redirect to
<errpage>?MSG=<message>&Return=<current local path>(BR-MVC-012). - On failure:
ThreadAbortExceptionis caught (withResetAbort) andResponse.End()runs inFinally.
Process flow¶
The following diagram visualizes this operation's control flow.
flowchart TD
Start([HandleErrors]) --> S1[Read support e-mail list setting]
S1 --> S2[CreateErrorWithEmail: log + notify support]
S2 --> D1{ErrorPageName configured?}
D1 -->|Yes| S3[Use configured error page]
D1 -->|No, internal caller| S4[Use intranet error page]
D1 -->|No, external caller| S5[Use public HTTPS error page]
S3 --> S6[HTML-encode message, strip CR/LF]
S4 --> S6
S5 --> S6
S6 --> EndOk([Redirect to error page with MSG + Return])
Failure and edge-case behavior¶
- A missing support e-mail list setting is passed straight to
clsLogError.CreateErrorWithEmailwith no null guard, risking a secondary failure inside the error handler.* - Redirect-induced
ThreadAbortExceptions are suppressed the same way as elsewhere in the framework so the redirect itself never surfaces as a second error.
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.
Sources¶
- SAIF.Presentation.Web.MVC/clsControllerBase.vb