Class JsonError
[JsonObject]
public class JsonError : JsonResponse
Inherited Members
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 SourceJsonError()
Create a new, empty JsonError
Declaration
[JsonConstructor]
public JsonError()
JsonError(GenericJsonData)
Create a new JsonError using a set of data
Declaration
public JsonError(GenericJsonData 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 |
JsonError(JsonRequest, String)
Create a new JsonError with a specific message
Declaration
public JsonError(JsonRequest request, string errorMessage)
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 SourceErrorKey
Key that identifies the error message data
Declaration
protected const string ErrorKey = "error"
Field Value
Type | Description |
---|---|
System.String |
Properties
View SourceError
The error message associated with this response
Declaration
[JsonIgnore]
public string Error { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceCreateJson(String)
Generate the JSON necessary to describe a JsonError based on a specified message
Declaration
public static string CreateJson(string message)
Parameters
Type | Name | Description |
---|---|---|
System.String | message | The error message |
Returns
Type | Description |
---|---|
System.String | A string of JSON describing a JsonError |