Skip to main content

MermaidErrorEventArgs

Namespace: Wisej.Web.Ext.Mermaid

Assembly: Wisej.Web.Ext.Mermaid (4.1.0.0)

Provides data for the Error event.

public class MermaidErrorEventArgs : EventArgs

This type is raised when Mermaid reports a client-side validation/parsing error.

Example:

mermaid.Error += (s, e) =>
{
// Inspect error details provided by the client, if any.
System.Diagnostics.Debug.WriteLine(e.Message);
System.Diagnostics.Debug.WriteLine(e.Error);
};

Constructors​

Instance member MermaidErrorEventArgs(message, error)​

Initializes a new instance of the MermaidErrorEventArgs class.

NameTypeDescription
messageStringHuman-readable error message.
errorObjectOptional raw error payload from the browser.

Example:

Raising the event from a derived control:

var args = new Wisej.Web.Ext.Mermaid.MermaidErrorEventArgs("Invalid diagram.");

Properties​

Instance member Error​

Object: Returns the optional error payload sent from the browser (typically a JSON-serializable object), or null.

This value is passed through as-is and may be an anonymous JSON-like object.

Example:

Inspecting the raw error payload:

mermaid.Error += (s, e) =>
{
// In many cases this will be a JSON object with Mermaid-specific fields.
var raw = e.Error;
};

Instance member Message​

String: Returns the human-readable error message.

When raised by the Mermaid widget, this is the message of the Mermaid parser error, or "Invalid Mermaid diagram." when the browser didn't provide one.

Example:

Showing the error to the user:

mermaid.Error += (s, e) => Wisej.Web.MessageBox.Show(e.Message);

Used By​

NameDescription
MermaidErrorEventHandlerRepresents the method that will handle the Error event in a Mermaid control.