-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathSubscription.razor
35 lines (31 loc) · 1.18 KB
/
Subscription.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<button type="button" class="[ bg-cyan-500 ] [ text-white ] [ px-4 py-2 ] [ inline-block ] [ rounded-md ] [ inline-flex ] [ space-x-1 ]" @onclick="Subscribe">
<p class="[ text-white ]">Subscribe Now</p>
<svg xmlns="http://www.w3.org/2000/svg" class="[ icon icon-tabler icon-tabler-rss ] [ text-white ]" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<circle cx="5" cy="19" r="1"></circle>
<path d="M4 4a16 16 0 0 1 16 16"></path>
<path d="M4 11a9 9 0 0 1 9 9"></path>
</svg>
</button>
@if (Exception is not null)
{
<pre class="[ bg-red-500 ] [ text-white ]">
@($"Error:ProcessError - Type: {Exception?.GetType()} Message: {Exception?.Message}")
</pre>
}
@code {
[CascadingParameter] public Error? Error { get; set; }
private Exception? Exception { get; set; }
protected void Subscribe()
{
try
{
throw new Exception();
}
catch (Exception ex)
{
Exception = ex;
Error?.ProcessError(ex);
}
}
}