StructuredResponse.backendError constructor
A backend exception as a reply: a BackendFailure keeps its kind, data and next steps; anything unknown is a backendToolError.
Implementation
factory StructuredResponse.backendError(String summary, Object e) => switch (e) {
IosToolchainBlocked() => StructuredResponse.toolchainBlocked(e),
BackendFailure() =>
StructuredResponse.error(summary: summary, errorKind: e.kind, detail: e.detail, nextSteps: e.nextSteps)
.mergeData(e.data),
UnsupportedBackendAction() => StructuredResponse.error(
summary: summary,
errorKind: GlintErrorKind.unsupportedBackendAction,
detail: e.detail,
nextSteps: e.nextSteps),
_ => StructuredResponse.error(summary: summary, errorKind: GlintErrorKind.backendToolError, detail: '$e'),
};