Token导航 LogoToken导航

Agent Skill · 研究检索

error-handling(错误处理)

error-handling 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合在 Codex、Claude、Cursor、Gemini CLI 中希望让 Agent 持续沉淀问题、修正和最佳实践时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

error-handling 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为可写文件;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,675 个 Skill 里排第 63,725。

总安装 312周安装 13GitHub Stars 公开资料未说明下载 104核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:error-handling(错误处理)
来源仓库:https://github.com/yosrbennagra/3sc
仓库路径:skills/error-handling
安装命令:
npx skills add yosrbennagra/3sc --skill "error-handling"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add yosrbennagra/3sc --skill "error-handling"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

error-handling 用于记录任务执行中的错误、用户纠正、经验和能力缺口,适合让 Agent 持续沉淀问题、修正和最佳实践。适用于错误处理相关的经验积累和最佳实践沉淀,可结合来源仓库和原始 README 继续核验具体用法。

通过 npx skills add yosrbennagra/3sc --skill "error-handling" 命令安装。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

来源仓库内路径:skills/error-handling

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add yosrbennagra/3sc --skill "error-handling";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要可写文件,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

error-handling 怎么安装?

在终端执行 npx skills add yosrbennagra/3sc --skill "error-handling"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

error-handling 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

error-handling 需要什么权限?

权限级别是可写文件。该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

error-handling 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

error-handling 用的人多吗?

公开数据是累计安装 312 次,近一周安装 13 次,下载 104 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

error-handling 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
error-handling

错误处理 · 本页

312—可写文件MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

name
error-handling
description
Global error handling for the 3SC widget host. Covers exception handling, crash reporting, user-friendly error surfaces, and recovery strategies.

Error Handling

Overview

Provide consistent, user-safe error handling across the shell, widgets, and background services. Users should never see stack traces or cryptic error messages.

Definition of Done (DoD)

  • [ ] Global handlers registered in App.xaml.cs for all exception sources
  • [ ] All exceptions logged with correlation IDs and context
  • [ ] User sees friendly, actionable error messages
  • [ ] Crash reports saved locally with sanitized data
  • [ ] No swallowed exceptions without explicit justification
  • [ ] Widget errors don't crash the host application

Global Exception Handlers

App.xaml.cs Registration

private void RegisterGlobalExceptionHandlers()
{
    // UI thread exceptions
    DispatcherUnhandledException += OnDispatcherUnhandledException;
    
    // Background thread exceptions
    AppDomain.CurrentDomain.UnhandledException += OnAppDomainUnhandledException;
    
    // Task exceptions that aren't observed
    TaskScheduler.UnobservedTaskException += OnUnobservedTaskException;
}

private void OnDispatcherUnhandledException(object sender, DispatcherUnhandledExceptionEventArgs e)
{
    var correlationId = CorrelationContext.Current ?? Guid.NewGuid().ToString("N")[..8];
    
    Log.Error(e.Exception, 
        "Unhandled UI exception. CorrelationId: {CorrelationId}", correlationId);
    
    // Save crash report
    CrashReportService.SaveReport(e.Exception, correlationId);
    
    // Show user-friendly message
    ShowErrorToUser(e.Exception, correlationId);
    
    // Prevent app crash for recoverable errors
    e.Handled = IsRecoverableError(e.Exception);
}

private void OnAppDomainUnhandledException(object sender, UnhandledExceptionEventArgs e)
{
    var exception = e.ExceptionObject as Exception;
    var correlationId = Guid.NewGuid().ToString("N")[..8];
    
    Log.Fatal(exception, 
        "Fatal unhandled exception. Terminating: {IsTerminating}, CorrelationId: {CorrelationId}", 
        e.IsTerminating, correlationId);
    
    CrashReportService.SaveReport(exception, correlationId);
}

private void OnUnobservedTaskException(object? sender, UnobservedTaskExceptionEventArgs e)
{
    Log.Error(e.Exception, "Unobserved task exception");
    
    // Prevent app crash - log and continue
    e.SetObserved();
}

Recoverable vs Fatal Errors

private static bool IsRecoverableError(Exception ex) => ex switch
{
    // Network issues - recoverable
    HttpRequestException => true,
    TaskCanceledException => true,
    
    // Database issues - might recover
    DbUpdateException => true,
    
    // Widget errors - definitely recoverable (isolate the widget)
    WidgetLoadException => true,
    WidgetExecutionException => true,
    
    // Memory/system issues - not recoverable
    OutOfMemoryException => false,
    StackOverflowException => false,
    AccessViolationException => false,
    
    _ => true  // Default to recoverable
};

ViewModel Error Handling

Async Command Pattern

[RelayCommand]
private async Task LoadWidgetsAsync(CancellationToken ct)
{
    IsLoading = true;
    ErrorMessage = null;
    
    try
    {
        var widgets = await _repository.GetAllAsync(ct);
        Widgets = new ObservableCollection<WidgetViewModel>(
            widgets.Select(w => new WidgetViewModel(w)));
    }
    catch (OperationCanceledException)
    {
        // User cancelled - not an error
        Log.Debug("Widget loading cancelled by user");
    }
    catch (Exception ex)
    {
        Log.Error(ex, "Failed to load widgets");
        ErrorMessage = "Failed to load widgets. Please try again.";
        
        // Optionally show toast/notification
        _notifications.ShowError("Could not load widgets");
    }
    finally
    {
        IsLoading = false;
    }
}

Error Display Patterns

public partial class WidgetLibraryViewModel : ObservableObject
{
    [ObservableProperty]
    private string? _errorMessage;
    
    [ObservableProperty]
    private ErrorSeverity _errorSeverity = ErrorSeverity.None;
    
    public bool HasError => !string.IsNullOrEmpty(ErrorMessage);
    
    private void SetError(string message, ErrorSeverity severity = ErrorSeverity.Error)
    {
        ErrorMessage = message;
        ErrorSeverity = severity;
        OnPropertyChanged(nameof(HasError));
    }
    
    private void ClearError()
    {
        ErrorMessage = null;
        ErrorSeverity = ErrorSeverity.None;
        OnPropertyChanged(nameof(HasError));
    }
}

public enum ErrorSeverity { None, Info, Warning, Error }

User Error Messages

Safe Message Mapping

public static class UserMessages
{
    public static string FromException(Exception ex) => ex switch
    {
        HttpRequestException => 
            "Unable to connect to the server. Please check your internet connection.",
        
        DbUpdateException => 
            "Failed to save changes. Please try again.",
        
        FileNotFoundException => 
            "The requested file could not be found.",
        
        UnauthorizedAccessException => 
            "Access denied. You may need to run as administrator.",
        
        WidgetLoadException wle => 
            $"Widget '{wle.WidgetKey}' failed to load. It may be corrupted or incompatible.",
        
        TimeoutException => 
            "The operation timed out. Please try again.",
        
        _ => "An unexpected error occurred. Please try again."
    };
    
    public static string WithCorrelationId(string message, string correlationId) =>
        $"{message}\n\nReference: {correlationId}";
}

Widget Error Isolation

public async Task<bool> SafeLoadWidgetAsync(string widgetKey)
{
    try
    {
        var widget = await _loader.LoadWidgetAsync(widgetKey);
        await widget.InitializeAsync();
        return true;
    }
    catch (Exception ex)
    {
        Log.Error(ex, "Widget {WidgetKey} failed to load", widgetKey);
        
        // Mark widget as problematic
        await _widgetRepo.MarkAsFailedAsync(widgetKey, ex.Message);
        
        // Notify user but don't crash
        _notifications.ShowError($"Widget '{widgetKey}' failed to load");
        
        return false;
    }
}

// Widget execution wrapper
public void SafeExecuteWidgetAction(string widgetKey, Action action)
{
    try
    {
        action();
    }
    catch (Exception ex)
    {
        Log.Error(ex, "Widget {WidgetKey} action failed", widgetKey);
        
        // Optionally disable the widget
        if (ShouldDisableWidget(ex))
        {
            DisableWidget(widgetKey, "Repeated failures");
        }
    }
}

Crash Reports

Crash Report Service

public static class CrashReportService
{
    private static readonly string CrashFolder = Path.Combine(
        Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData),
        "3SC", "crashes");
    
    public static void SaveReport(Exception? exception, string correlationId)
    {
        try
        {
            Directory.CreateDirectory(CrashFolder);
            
            var report = new CrashReport
            {
                Timestamp = DateTimeOffset.UtcNow,
                CorrelationId = correlationId,
                AppVersion = GetAppVersion(),
                OsVersion = Environment.OSVersion.ToString(),
                ExceptionType = exception?.GetType().FullName,
                Message = exception?.Message,
                StackTrace = SanitizeStackTrace(exception?.ToString()),
                AdditionalContext = GatherContext()
            };
            
            var fileName = $"crash_{DateTime.UtcNow:yyyyMMdd_HHmmss}_{correlationId}.json";
            var filePath = Path.Combine(CrashFolder, fileName);
            
            File.WriteAllText(filePath, JsonSerializer.Serialize(report, new JsonSerializerOptions
            {
                WriteIndented = true
            }));
            
            // Cleanup old reports (keep last 50)
            CleanupOldReports(maxReports: 50);
        }
        catch
        {
            // Never throw from crash reporting
        }
    }
    
    private static string? SanitizeStackTrace(string? stackTrace)
    {
        if (string.IsNullOrEmpty(stackTrace)) return null;
        
        var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
        return stackTrace.Replace(userProfile, "[USER]");
    }
}

Error UI Components

Error Banner (XAML)

<Border x:Name="ErrorBanner"
        Visibility="{Binding HasError, Converter={StaticResource BoolToVisibility}}"
        Background="{DynamicResource ErrorBackgroundBrush}"
        Padding="12,8">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>
        
        <Path Data="{StaticResource ErrorIcon}" 
              Fill="{DynamicResource ErrorForegroundBrush}" />
        
        <TextBlock Grid.Column="1" 
                   Text="{Binding ErrorMessage}"
                   Foreground="{DynamicResource ErrorForegroundBrush}"
                   Margin="8,0" />
        
        <Button Grid.Column="2" 
                Command="{Binding DismissErrorCommand}"
                Content="✕"
                Style="{StaticResource IconButton}" />
    </Grid>
</Border>

Best Practices

PracticeReason
Log before showing user messageCapture full context for debugging
Include correlation IDEnables support to find logs
Sanitize sensitive dataProtect user privacy in reports
Isolate widget errorsDon't let plugins crash the host
Use structured exception typesEasier to handle specifically
Provide actionable messagesHelp users resolve issues

Anti-Patterns

Anti-PatternProblemSolution
catch { }Swallows all errors silentlyAt minimum log the exception
Showing stack tracesConfuses users, security riskMap to friendly messages
Throwing from exception handlersRecursive failureAlways catch in handlers
Generic error messages onlyUser can't act on themBe specific when possible

References

  • references/global-handlers.md for exception hooks
  • references/ui-errors.md for UI surface patterns
  • references/crash-reporting.md for report capture and storage

平台分布

Gemini CLI

30.29%
按下载量换算32

windsurf

23.61%
按下载量换算25

trae

17.95%
按下载量换算19

OpenCode

11.95%
按下载量换算12

Codex

7.92%
按下载量换算8

Claude Code

4%
按下载量换算4

安全审计

暂无安全审计结果可展示。

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills