diff --git a/lib/pages/flow_editor.dart b/lib/pages/flow_editor.dart index ca45628..af0e2f3 100644 --- a/lib/pages/flow_editor.dart +++ b/lib/pages/flow_editor.dart @@ -639,9 +639,41 @@ class _RunResult extends StatelessWidget { ), const SizedBox(height: FaiSpace.sm), if (running) const LinearProgressIndicator(), - if (error != null) - FaiErrorBox(error: error, isError: true) - else if (outputs != null) + if (error != null) ...[ + // Map raw exceptions through friendlyError so the + // operator sees a sentence + a recovery hint + // instead of a stack trace. The verbatim error + // stays accessible via FaiErrorBox's expand-on-tap. + Builder( + builder: (ctx) { + final fe = friendlyError(error!, l); + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + fe.headline, + style: Theme.of(ctx).textTheme.bodyMedium?.copyWith( + color: Theme.of(ctx).colorScheme.error, + ), + ), + if (fe.hint != null) ...[ + const SizedBox(height: FaiSpace.xs), + Text( + fe.hint!, + style: Theme.of(ctx).textTheme.bodySmall, + ), + ], + const SizedBox(height: FaiSpace.sm), + FaiErrorBox( + error: fe.detail, + isError: true, + maxHeight: 200, + ), + ], + ); + }, + ), + ] else if (outputs != null) Expanded( child: ListView( children: [