Search Results for

    Show / Hide Table of Contents

    Class JsonError

    • C#
    • Visual Basic
    [JsonObject]
    public class JsonError : JsonResponse
    <JsonObject>
    Public Class JsonError
        Inherits JsonResponse
    Inheritance
    System.Object
    GenericJsonData
    JsonRequest
    JsonResponse
    JsonError
    Inherited Members
    JsonResponse.ResponseKey
    JsonResponse.Response
    JsonRequest.RequestKey
    JsonRequest.Request
    GenericJsonData.Data
    GenericJsonData.FromJson(String)
    GenericJsonData.Contains(String)
    GenericJsonData.Get(String)
    GenericJsonData.Put(String, String)
    GenericJsonData.Remove(String)
    GenericJsonData.Clear()
    GenericJsonData.ToJson()
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: HomeSeer.PluginSdk.Features.Responses
    Assembly: PluginSdk.dll


    A POST error response for a feature page as a collection of key-value pairs


    Remarks

    A default handler is provided for you in the FeaturePagePost.js page. Include that file with your plugin's feature pages and customize it as needed. A shared version will be implemented in a future release.

    Constructors

    View Source

    JsonError()

    Create a new, empty JsonError

    Declaration
    • C#
    • Visual Basic
    [JsonConstructor]
    public JsonError()
    <JsonConstructor>
    Public Sub New
    View Source

    JsonError(GenericJsonData)

    Create a new JsonError using a set of data

    Declaration
    • C#
    • Visual Basic
    public JsonError(GenericJsonData genericJsonData)
    Public Sub New(genericJsonData As GenericJsonData)
    Parameters
    Type Name Description
    GenericJsonData genericJsonData

    The GenericJsonData that describes the error

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown when no data is provided

    System.Collections.Generic.KeyNotFoundException

    Thrown when no Error message is defined in the data

    View Source

    JsonError(JsonRequest, String)

    Create a new JsonError with a specific message

    Declaration
    • C#
    • Visual Basic
    public JsonError(JsonRequest request, string errorMessage)
    Public Sub New(request As JsonRequest, errorMessage As String)
    Parameters
    Type Name Description
    JsonRequest request

    The JsonRequest to base this response on

    System.String errorMessage

    The error message

    Exceptions
    Type Condition
    System.ArgumentNullException

    Thrown if no error message is provided

    Fields

    View Source

    ErrorKey

    Key that identifies the error message data

    Declaration
    • C#
    • Visual Basic
    protected const string ErrorKey = "error"
    Protected Const ErrorKey As String = "error"
    Field Value
    Type Description
    System.String

    Properties

    View Source

    Error

    The error message associated with this response

    Declaration
    • C#
    • Visual Basic
    [JsonIgnore]
    public string Error { get; set; }
    <JsonIgnore>
    Public Property Error As String
    Property Value
    Type Description
    System.String

    Methods

    View Source

    CreateJson(String)

    Generate the JSON necessary to describe a JsonError based on a specified message

    Declaration
    • C#
    • Visual Basic
    public static string CreateJson(string message)
    Public Shared Function CreateJson(message As String) As String
    Parameters
    Type Name Description
    System.String message

    The error message

    Returns
    Type Description
    System.String

    A string of JSON describing a JsonError

    • View Source
    In This Article
    Back to top HomeSeer Technologies