Error class final

JSON-RPC error object.

Represents an error that occurred during method execution, following the JSON-RPC 2.0 error object specification with optional additional data.

See protocol docs: JSON-RPC Error Object

Implemented types
Annotations
  • @JsonSerializable.new(createFactory: false, createToJson: false)

Constructors

Error({required ErrorCode code, required String message, AcpJsonValue? data})
Creates a Error value.
Error.fromJson(Map<String, Object?> json)
Decodes a JSON object, discarding recoverable issues.
factory

Properties

code ErrorCode
A number indicating the error type that occurred. This must be an integer as defined in the JSON-RPC specification.
final
data AcpJsonValue?
Optional primitive or structured value that contains additional information about the error. This may include debugging information or context-specific details.
final
hashCode int
The hash code for this object.
no setterinherited
message String
A string providing a short description of the error. The message should be limited to a concise single sentence.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toAcpJson() AcpJsonObject
Converts this protocol value to its immutable JSON representation.
override
toJson() Map<String, Object?>
Encodes this value to its wire object.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

decode(Object? json) → AcpDecoded<Error>
Decodes this model and reports recoverable issues.