refactor: FaiError -> ChainError (SDK stub rename lockstep)
Some checks failed
Security / Security check (push) Failing after 1s
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:
parent
bb606a8b23
commit
7a38cd58aa
13 changed files with 30 additions and 30 deletions
|
|
@ -32,7 +32,7 @@ import 'chain_log.dart';
|
|||
/// back to a Material default duration of 6 seconds — twice
|
||||
/// the framework default so the operator has time to click
|
||||
/// copy on an unfamiliar message.
|
||||
void showFaiErrorSnack(
|
||||
void showChainErrorSnack(
|
||||
BuildContext context,
|
||||
String source,
|
||||
Object error, {
|
||||
|
|
@ -101,7 +101,7 @@ void showFaiProcessError(
|
|||
final detail = [stderr.trim(), stdout.trim()]
|
||||
.where((s) => s.isNotEmpty)
|
||||
.join('\n\n');
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
source,
|
||||
detail.isEmpty ? 'process exited non-zero (no output)' : detail,
|
||||
|
|
@ -122,7 +122,7 @@ Future<void> showFaiProcessErrorDialog(
|
|||
final detail = [stderr.trim(), stdout.trim()]
|
||||
.where((s) => s.isNotEmpty)
|
||||
.join('\n\n');
|
||||
return showFaiErrorDialog(
|
||||
return showChainErrorDialog(
|
||||
context,
|
||||
source,
|
||||
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
|
||||
/// failure blocks meaningful interaction (auth missing, hub
|
||||
/// unreachable) — a SnackBar would be too easy to dismiss.
|
||||
Future<void> showFaiErrorDialog(
|
||||
Future<void> showChainErrorDialog(
|
||||
BuildContext context,
|
||||
String source,
|
||||
Object error, {
|
||||
|
|
|
|||
|
|
@ -95,14 +95,14 @@ class _AuditPageState extends State<AuditPage> {
|
|||
_refresh();
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
showFaiErrorSnack(context, 'audit.clear', e);
|
||||
showChainErrorSnack(context, 'audit.clear', e);
|
||||
}
|
||||
}
|
||||
|
||||
// _friendly was an inline shadow of friendlyError() in
|
||||
// data/friendly_error.dart — kept only because the original
|
||||
// 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
|
||||
// copy-affordance).
|
||||
|
||||
|
|
|
|||
|
|
@ -457,7 +457,7 @@ class _PathRow extends StatelessWidget {
|
|||
);
|
||||
if (!context.mounted) return;
|
||||
if (!r.ok) {
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
'doctor.open-path',
|
||||
r.stderr.isEmpty ? 'open failed' : r.stderr,
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class _FederationPageState extends State<FederationPage> {
|
|||
_refresh();
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
showFaiErrorSnack(context, 'federation.issue', e,
|
||||
showChainErrorSnack(context, 'federation.issue', e,
|
||||
title: l.federationIssueFailed(''));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ class _FlowsPageState extends State<FlowsPage> {
|
|||
final l = AppLocalizations.of(context);
|
||||
// Copyable error (was a plain SnackBar) — install failures
|
||||
// carry the real cause (network, signature, store lookup).
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
'flows.install',
|
||||
e,
|
||||
|
|
|
|||
|
|
@ -756,7 +756,7 @@ class _StorePageState extends State<StorePage> {
|
|||
_runSearch();
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
'store.provider.add',
|
||||
e,
|
||||
|
|
@ -2392,7 +2392,7 @@ class _StoreDetailSheetState extends State<_StoreDetailSheet> {
|
|||
final r = await SystemActions.openInOs(widget.item.repository);
|
||||
if (!mounted) return;
|
||||
if (!r.ok) {
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
'store.repository.open',
|
||||
r.stderr.isEmpty ? 'open failed' : r.stderr,
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ class ChainErrorBox extends StatefulWidget {
|
|||
);
|
||||
|
||||
@override
|
||||
State<ChainErrorBox> createState() => _FaiErrorBoxState();
|
||||
State<ChainErrorBox> createState() => _ChainErrorBoxState();
|
||||
}
|
||||
|
||||
class _FaiErrorBoxState extends State<ChainErrorBox> {
|
||||
class _ChainErrorBoxState extends State<ChainErrorBox> {
|
||||
bool _justCopied = false;
|
||||
bool _detailExpanded = false;
|
||||
|
||||
|
|
|
|||
|
|
@ -173,7 +173,7 @@ class _BytesView extends StatelessWidget {
|
|||
).showSnackBar(SnackBar(content: Text(l.flowsOutputSavedAt(path))));
|
||||
} catch (e) {
|
||||
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 r = await SystemActions.openInOs(target);
|
||||
if (!context.mounted || r.ok) return;
|
||||
showFaiErrorSnack(
|
||||
showChainErrorSnack(
|
||||
context,
|
||||
'flows.output.open',
|
||||
r.stderr.isEmpty ? 'open failed' : r.stderr,
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class _FaiModuleSheetState extends State<ChainModuleSheet> {
|
|||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
setState(() => _uninstalling = false);
|
||||
showFaiErrorSnack(context, 'modules.uninstall', e);
|
||||
showChainErrorSnack(context, 'modules.uninstall', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ class _FaiSettingsDialogState extends State<ChainSettingsDialog> {
|
|||
).showSnackBar(SnackBar(content: Text(l.hubAuthTokenSavedToast)));
|
||||
} catch (e) {
|
||||
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)));
|
||||
} catch (e) {
|
||||
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)));
|
||||
} catch (e) {
|
||||
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)));
|
||||
} catch (e) {
|
||||
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))));
|
||||
} catch (e) {
|
||||
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);
|
||||
} catch (e) {
|
||||
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);
|
||||
} catch (e) {
|
||||
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))));
|
||||
} catch (e) {
|
||||
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);
|
||||
} catch (e) {
|
||||
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);
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
showFaiErrorSnack(context, 'settings.mcp.refresh', e);
|
||||
showChainErrorSnack(context, 'settings.mcp.refresh', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ class _ChainStoresDialogState extends State<ChainStoresDialog> {
|
|||
_reload();
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
showFaiErrorSnack(context, 'store.add', e,
|
||||
showChainErrorSnack(context, 'store.add', e,
|
||||
title: AppLocalizations.of(context)!.storesManagerAddFailed);
|
||||
}
|
||||
} finally {
|
||||
|
|
@ -131,7 +131,7 @@ class _ChainStoresDialogState extends State<ChainStoresDialog> {
|
|||
_reload();
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
showFaiErrorSnack(context, 'store.remove', e,
|
||||
showChainErrorSnack(context, 'store.remove', e,
|
||||
title: AppLocalizations.of(context)!.storesManagerRemoveFailed);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -271,7 +271,7 @@ class _FaiSystemAiEditorState extends State<ChainSystemAiEditor> {
|
|||
});
|
||||
} catch (e) {
|
||||
if (!mounted) return;
|
||||
showFaiErrorSnack(context, 'settings.system-ai.cache-clear', e);
|
||||
showChainErrorSnack(context, 'settings.system-ai.cache-clear', e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue