SyniRuntimeError class

Thrown when the runtime, model, or inference call fails.

When the failure originated from the native runtime's structured failure envelope ({"ok":false,"error":{"code","message","retryable"}}), code and retryable carry the machine-readable classification so callers can branch (e.g. re-authenticate, offer a Retry) instead of pattern-matching message.

Implemented types

Constructors

SyniRuntimeError(String message, {String? code, bool retryable = false})
SyniRuntimeError.fromEnvelope(Map<String, dynamic> error)
Build from a runtime failure envelope's error object. Defensive against a malformed envelope: a non-string message/code becomes null (→ a generic message / UNKNOWN), and any non-true retryable is false.
factory
SyniRuntimeError.protocol(String detail)
A client-side protocol failure: the native output could not be parsed as the documented envelope (malformed JSON, non-object, etc.). Distinct from a runtime domain failure — never a successful response.
factory

Properties

code String?
Stable machine-readable code (MODEL_UNAVAILABLE, TIMEOUT, INVALID_ARGUMENT, …), or null when the error did not come from a runtime failure envelope. Treat an unrecognized value as UNKNOWN.
final
hashCode int
The hash code for this object.
no setterinherited
message String
Human-readable, safe to show to users.
final
retryable bool
True only for transient failures the runtime marked retryable (TIMEOUT, INVALID_JSON, SCHEMA).
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