ConnectException class final

ConnectException captures four pieces of information: a Code, an error message, an optional cause of the error, and an optional collection of arbitrary Protobuf messages called "details".

Because developer tools typically print just the toString message, we prefix it with the status code, so that the most important information is always visible immediately.

Error details are wrapped with google.protobuf.Any on the wire, so that a server or middleware can attach arbitrary data to an error.

Implemented types

Constructors

ConnectException.new(Code code, String message, {Object? cause, Headers? metadata, List<ErrorDetail>? details})
ConnectException.from(Object reason, [Code code = Code.unknown])
Convert any value - typically a caught exception into a ConnectException, following these rules:
factory

Properties

cause Object?
The underlying cause of this error, if any. In cases where the actual cause is elided with the error message, the cause is specified here so that we don't leak the underlying error, but instead make it available for logging.
final
code Code
The Code for this error.
final
details List<ErrorDetail>
Incoming error details are stored in this property.
final
hashCode int
The hash code for this object.
no setterinherited
message String
The error message.
final
metadata Headers
A union of response headers and trailers associated with this error.
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
toString() String
A string representation of this object.
override

Operators

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