SyniRuntimeError.fromEnvelope constructor

SyniRuntimeError.fromEnvelope(
  1. 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.

Implementation

factory SyniRuntimeError.fromEnvelope(Map<String, dynamic> error) =>
    SyniRuntimeError(
      _asString(error['message']) ?? 'unknown runtime error',
      code: _asString(error['code']) ?? 'UNKNOWN',
      retryable: error['retryable'] == true,
    );