-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
43e7d8e
commit 298ba09
Showing
3 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
src/KristofferStrube.Blazor.Window/Events/ErrorEventInit.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
using KristofferStrube.Blazor.DOM; | ||
using Microsoft.JSInterop; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace KristofferStrube.Blazor.Window; | ||
|
||
/// <summary> | ||
/// The options specific to initializing an <see cref="ErrorEvent"/>. | ||
/// </summary> | ||
/// <remarks><see href="https://html.spec.whatwg.org/#erroreventinit">See the API definition here</see>.</remarks> | ||
public class ErrorEventInit : EventInit | ||
{ | ||
/// <summary> | ||
/// It represents the error message. | ||
/// </summary> | ||
[JsonPropertyName("message")] | ||
public string Message { get; set; } = ""; | ||
|
||
/// <summary> | ||
/// It represents the URL of the script in which the error originally occurred. | ||
/// </summary> | ||
[JsonPropertyName("filename")] | ||
public string FileName { get; set; } = ""; | ||
|
||
/// <summary> | ||
/// It represents the line number where the error occurred in the script. | ||
/// </summary> | ||
[JsonPropertyName("lineno")] | ||
public ulong LineNumber { get; set; } = 0; | ||
|
||
/// <summary> | ||
/// It represents the column number where the error occurred in the script. | ||
/// </summary> | ||
[JsonPropertyName("colno")] | ||
public ulong ColumnNumber { get; set; } = 0; | ||
|
||
/// <summary> | ||
/// Where appropriate, it is set to the object representing the error (e.g., the exception object in the case of an uncaught exception). | ||
/// </summary> | ||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] | ||
[JsonPropertyName("error")] | ||
public IJSObjectReference? Error { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters