refactor: FaiError -> ChainError (SDK stub rename lockstep)
Some checks failed
Security / Security check (push) Failing after 1s

Signed-off-by: flemming-it <stefan.a.flemming@googlemail.com>
This commit is contained in:
flemming-it 2026-07-11 23:14:33 +02:00
parent bb606a8b23
commit 7a38cd58aa
13 changed files with 30 additions and 30 deletions

View file

@ -32,7 +32,7 @@ import 'chain_log.dart';
/// back to a Material default duration of 6 seconds twice /// back to a Material default duration of 6 seconds twice
/// the framework default so the operator has time to click /// the framework default so the operator has time to click
/// copy on an unfamiliar message. /// copy on an unfamiliar message.
void showFaiErrorSnack( void showChainErrorSnack(
BuildContext context, BuildContext context,
String source, String source,
Object error, { Object error, {
@ -101,7 +101,7 @@ void showFaiProcessError(
final detail = [stderr.trim(), stdout.trim()] final detail = [stderr.trim(), stdout.trim()]
.where((s) => s.isNotEmpty) .where((s) => s.isNotEmpty)
.join('\n\n'); .join('\n\n');
showFaiErrorSnack( showChainErrorSnack(
context, context,
source, source,
detail.isEmpty ? 'process exited non-zero (no output)' : detail, detail.isEmpty ? 'process exited non-zero (no output)' : detail,
@ -122,7 +122,7 @@ Future<void> showFaiProcessErrorDialog(
final detail = [stderr.trim(), stdout.trim()] final detail = [stderr.trim(), stdout.trim()]
.where((s) => s.isNotEmpty) .where((s) => s.isNotEmpty)
.join('\n\n'); .join('\n\n');
return showFaiErrorDialog( return showChainErrorDialog(
context, context,
source, source,
detail.isEmpty ? 'process exited non-zero (no output)' : detail, detail.isEmpty ? 'process exited non-zero (no output)' : detail,
@ -133,7 +133,7 @@ Future<void> showFaiProcessErrorDialog(
/// Show [error] as a centered modal dialog. Use this when the /// Show [error] as a centered modal dialog. Use this when the
/// failure blocks meaningful interaction (auth missing, hub /// failure blocks meaningful interaction (auth missing, hub
/// unreachable) a SnackBar would be too easy to dismiss. /// unreachable) a SnackBar would be too easy to dismiss.
Future<void> showFaiErrorDialog( Future<void> showChainErrorDialog(
BuildContext context, BuildContext context,
String source, String source,
Object error, { Object error, {

View file

@ -95,14 +95,14 @@ class _AuditPageState extends State<AuditPage> {
_refresh(); _refresh();
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'audit.clear', e); showChainErrorSnack(context, 'audit.clear', e);
} }
} }
// _friendly was an inline shadow of friendlyError() in // _friendly was an inline shadow of friendlyError() in
// data/friendly_error.dart kept only because the original // data/friendly_error.dart kept only because the original
// call site predated the central mapper. Removed in favour // call site predated the central mapper. Removed in favour
// of showFaiErrorSnack, which uses friendlyError under the // of showChainErrorSnack, which uses friendlyError under the
// hood (with proper gRPC-code mapping + selectable // hood (with proper gRPC-code mapping + selectable
// copy-affordance). // copy-affordance).

View file

@ -457,7 +457,7 @@ class _PathRow extends StatelessWidget {
); );
if (!context.mounted) return; if (!context.mounted) return;
if (!r.ok) { if (!r.ok) {
showFaiErrorSnack( showChainErrorSnack(
context, context,
'doctor.open-path', 'doctor.open-path',
r.stderr.isEmpty ? 'open failed' : r.stderr, r.stderr.isEmpty ? 'open failed' : r.stderr,

View file

@ -49,7 +49,7 @@ class _FederationPageState extends State<FederationPage> {
_refresh(); _refresh();
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'federation.issue', e, showChainErrorSnack(context, 'federation.issue', e,
title: l.federationIssueFailed('')); title: l.federationIssueFailed(''));
} }
} }

View file

@ -132,7 +132,7 @@ class _FlowsPageState extends State<FlowsPage> {
final l = AppLocalizations.of(context); final l = AppLocalizations.of(context);
// Copyable error (was a plain SnackBar) install failures // Copyable error (was a plain SnackBar) install failures
// carry the real cause (network, signature, store lookup). // carry the real cause (network, signature, store lookup).
showFaiErrorSnack( showChainErrorSnack(
context, context,
'flows.install', 'flows.install',
e, e,

View file

@ -756,7 +756,7 @@ class _StorePageState extends State<StorePage> {
_runSearch(); _runSearch();
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack( showChainErrorSnack(
context, context,
'store.provider.add', 'store.provider.add',
e, e,
@ -2392,7 +2392,7 @@ class _StoreDetailSheetState extends State<_StoreDetailSheet> {
final r = await SystemActions.openInOs(widget.item.repository); final r = await SystemActions.openInOs(widget.item.repository);
if (!mounted) return; if (!mounted) return;
if (!r.ok) { if (!r.ok) {
showFaiErrorSnack( showChainErrorSnack(
context, context,
'store.repository.open', 'store.repository.open',
r.stderr.isEmpty ? 'open failed' : r.stderr, r.stderr.isEmpty ? 'open failed' : r.stderr,

View file

@ -53,10 +53,10 @@ class ChainErrorBox extends StatefulWidget {
); );
@override @override
State<ChainErrorBox> createState() => _FaiErrorBoxState(); State<ChainErrorBox> createState() => _ChainErrorBoxState();
} }
class _FaiErrorBoxState extends State<ChainErrorBox> { class _ChainErrorBoxState extends State<ChainErrorBox> {
bool _justCopied = false; bool _justCopied = false;
bool _detailExpanded = false; bool _detailExpanded = false;

View file

@ -173,7 +173,7 @@ class _BytesView extends StatelessWidget {
).showSnackBar(SnackBar(content: Text(l.flowsOutputSavedAt(path)))); ).showSnackBar(SnackBar(content: Text(l.flowsOutputSavedAt(path))));
} catch (e) { } catch (e) {
if (!context.mounted) return; if (!context.mounted) return;
showFaiErrorSnack(context, 'flows.output.save', e); showChainErrorSnack(context, 'flows.output.save', e);
} }
} }
@ -234,7 +234,7 @@ class _FileView extends StatelessWidget {
final target = uri.startsWith('file://') ? uri.substring(7) : uri; final target = uri.startsWith('file://') ? uri.substring(7) : uri;
final r = await SystemActions.openInOs(target); final r = await SystemActions.openInOs(target);
if (!context.mounted || r.ok) return; if (!context.mounted || r.ok) return;
showFaiErrorSnack( showChainErrorSnack(
context, context,
'flows.output.open', 'flows.output.open',
r.stderr.isEmpty ? 'open failed' : r.stderr, r.stderr.isEmpty ? 'open failed' : r.stderr,

View file

@ -107,7 +107,7 @@ class _FaiModuleSheetState extends State<ChainModuleSheet> {
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
setState(() => _uninstalling = false); setState(() => _uninstalling = false);
showFaiErrorSnack(context, 'modules.uninstall', e); showChainErrorSnack(context, 'modules.uninstall', e);
} }
} }

View file

@ -100,7 +100,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.hubAuthTokenSavedToast))); ).showSnackBar(SnackBar(content: Text(l.hubAuthTokenSavedToast)));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'auth.hub-token.save', e); showChainErrorSnack(context, 'auth.hub-token.save', e);
} }
} }
@ -116,7 +116,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.hubAuthTokenClearedToast))); ).showSnackBar(SnackBar(content: Text(l.hubAuthTokenClearedToast)));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'auth.hub-token.clear', e); showChainErrorSnack(context, 'auth.hub-token.clear', e);
} }
} }
@ -141,7 +141,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.registryTokenSavedToast))); ).showSnackBar(SnackBar(content: Text(l.registryTokenSavedToast)));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'auth.registry-token.save', e); showChainErrorSnack(context, 'auth.registry-token.save', e);
} }
} }
@ -156,7 +156,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.registryTokenClearedToast))); ).showSnackBar(SnackBar(content: Text(l.registryTokenClearedToast)));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'auth.registry-token.clear', e); showChainErrorSnack(context, 'auth.registry-token.clear', e);
} }
} }
@ -186,7 +186,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.addedN8nToast(draft.name)))); ).showSnackBar(SnackBar(content: Text(l.addedN8nToast(draft.name))));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.n8n.add', e); showChainErrorSnack(context, 'settings.n8n.add', e);
} }
} }
@ -197,7 +197,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
setState(() => _n8nEndpoints = list); setState(() => _n8nEndpoints = list);
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.n8n.remove', e); showChainErrorSnack(context, 'settings.n8n.remove', e);
} }
} }
@ -208,7 +208,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
setState(() => _n8nEndpoints = list); setState(() => _n8nEndpoints = list);
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.n8n.refresh', e); showChainErrorSnack(context, 'settings.n8n.refresh', e);
} }
} }
@ -238,7 +238,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
).showSnackBar(SnackBar(content: Text(l.addedMcpToast(draft.name)))); ).showSnackBar(SnackBar(content: Text(l.addedMcpToast(draft.name))));
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.mcp.add', e); showChainErrorSnack(context, 'settings.mcp.add', e);
} }
} }
@ -249,7 +249,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
setState(() => _mcpClients = list); setState(() => _mcpClients = list);
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.mcp.remove', e); showChainErrorSnack(context, 'settings.mcp.remove', e);
} }
} }
@ -260,7 +260,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
setState(() => _mcpClients = list); setState(() => _mcpClients = list);
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.mcp.refresh', e); showChainErrorSnack(context, 'settings.mcp.refresh', e);
} }
} }

View file

@ -114,7 +114,7 @@ class _ChainStoresDialogState extends State<ChainStoresDialog> {
_reload(); _reload();
} catch (e) { } catch (e) {
if (mounted) { if (mounted) {
showFaiErrorSnack(context, 'store.add', e, showChainErrorSnack(context, 'store.add', e,
title: AppLocalizations.of(context)!.storesManagerAddFailed); title: AppLocalizations.of(context)!.storesManagerAddFailed);
} }
} finally { } finally {
@ -131,7 +131,7 @@ class _ChainStoresDialogState extends State<ChainStoresDialog> {
_reload(); _reload();
} catch (e) { } catch (e) {
if (mounted) { if (mounted) {
showFaiErrorSnack(context, 'store.remove', e, showChainErrorSnack(context, 'store.remove', e,
title: AppLocalizations.of(context)!.storesManagerRemoveFailed); title: AppLocalizations.of(context)!.storesManagerRemoveFailed);
} }
} }

View file

@ -271,7 +271,7 @@ class _FaiSystemAiEditorState extends State<ChainSystemAiEditor> {
}); });
} catch (e) { } catch (e) {
if (!mounted) return; if (!mounted) return;
showFaiErrorSnack(context, 'settings.system-ai.cache-clear', e); showChainErrorSnack(context, 'settings.system-ai.cache-clear', e);
} }
} }

View file

@ -46,7 +46,7 @@ packages:
path: "../fai_chain_studio_flow_editor" path: "../fai_chain_studio_flow_editor"
relative: true relative: true
source: path source: path
version: "0.21.0" version: "0.21.2"
characters: characters:
dependency: transitive dependency: transitive
description: description: