# Error

- File ID: file:p5ean4:error-razor
- Path: NexusReader.Web/Components/Pages/Error.razor
- Role: ui-page
- Layer: frontend

## Purpose

A Blazor Razor page component that renders an error UI and exposes the current request identifier (from Activity or HttpContext) for diagnostic display.

## Key Details

Renders an error page; resolves RequestId from Activity.Current?.Id first then HttpContext?.TraceIdentifier; conditionally shows the Request ID in the UI when available.

## Symbols

- Error: A Blazor Razor page component that renders an error UI and exposes the current request identifier (from Activity or HttpContext) for diagnostic display.
- HttpContext (CascadingParameter property): Receives the current HttpContext as a cascading parameter so the component can access TraceIdentifier when Activity is not available.
- RequestId (backing state): Holds the resolved request identifier used by the UI.
- ShowRequestId (computed property): Returns true when RequestId is non-empty so the UI can conditionally render the Request ID block.
- OnInitialized(): Initializes component state by resolving the request identifier from Activity.Current or falling back to HttpContext.TraceIdentifier.
- Render: conditional RequestId block(): Razor conditional block that renders the Request ID markup only when ShowRequestId is true.

## Dependencies

- No resolved dependencies.

## Calls

- No resolved calls.

## Coverage

- Symbols: 6
- Executable symbols: 5
- Executable symbols with control flow: 5
- Grounded edges: 6
- Unresolved references: 0
- Control-flow fragments: 5
- Unresolved jumps: 0
- Unsupported constructs: 0
- Control-flow coverage: 100%
- Required diagrams: 2
- Generated diagrams: 3

## Control Flow Fragments

- HttpContext (CascadingParameter property): 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- RequestId (backing state): 3 nodes, 2 edges, 0 jumps, 0 unsupported constructs
- ShowRequestId (computed property): 6 nodes, 6 edges, 0 jumps, 0 unsupported constructs
- OnInitialized: 7 nodes, 7 edges, 0 jumps, 0 unsupported constructs
- Render: conditional RequestId block: 10 nodes, 11 edges, 0 jumps, 0 unsupported constructs

## Diagrams

### Error Neighborhood

```mermaid
flowchart LR
    class_1jtdq7s_error("Error")
    file_p5ean4_error_razor("Error")
    method_1jr0xbp_requestid_backing_state[["RequestId (backing state)"]]
    method_1oj8i7o_render_conditional_requestid_block[["Render: conditional RequestId block()"]]
    method_76zo3r_httpcontext_cascadingparameter_property[["HttpContext (CascadingParameter property)"]]
    method_7gn3l8_oninitialized[["OnInitialized()"]]
    method_z2iy0h_showrequestid_computed_property[["ShowRequestId (computed property)"]]
```

### Error Execution Overview

```mermaid
flowchart TD
    class_1jtdq7s_error("Error")
    method_1jr0xbp_requestid_backing_state[["RequestId (backing state)"]]
    method_1oj8i7o_render_conditional_requestid_block[["Render: conditional RequestId block()"]]
    method_76zo3r_httpcontext_cascadingparameter_property[["HttpContext (CascadingParameter property)"]]
    method_7gn3l8_oninitialized[["OnInitialized()"]]
    method_z2iy0h_showrequestid_computed_property[["ShowRequestId (computed property)"]]
    class_1jtdq7s_error -->|contains| method_1jr0xbp_requestid_backing_state
    class_1jtdq7s_error -->|contains| method_1oj8i7o_render_conditional_requestid_block
    class_1jtdq7s_error -->|contains| method_76zo3r_httpcontext_cascadingparameter_property
    class_1jtdq7s_error -->|contains| method_7gn3l8_oninitialized
    class_1jtdq7s_error -->|contains| method_z2iy0h_showrequestid_computed_property
```

### Render: conditional RequestId block() Control Flow

```mermaid
flowchart TD
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__condition{"ShowRequestId is true"}
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__false("skip rendering Request ID")
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__merge("merge")
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__true("render <p> with Request ID")
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__condition{"ShowRequestId"}
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__false("false")
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__merge("merge")
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__true("true")
    method_1oj8i7o_render_conditional_requestid_block__entry(["Render: conditional RequestId block entry"])
    method_1oj8i7o_render_conditional_requestid_block__implicit_return(["return"])
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__condition -->|skip rendering Request ID| method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__false
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__condition -->|render p> with Request ID| method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__true
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__false -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__merge
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__merge -->|return| method_1oj8i7o_render_conditional_requestid_block__implicit_return
    method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__true -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__merge
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__condition -->|false| method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__false
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__condition -->|true| method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__true
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__false -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__merge
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__merge -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_branch_9__condition
    method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__true -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__merge
    method_1oj8i7o_render_conditional_requestid_block__entry -->|next| method_1oj8i7o_render_conditional_requestid_block__action_9_render_conditional_requestid_block_branch_9_0__condition
```

## Diagram Validation

- Status: pass
