mitchellh/panicwrap — explained in plain English
Analysis updated 2026-07-03 · repo last pushed 2024-04-05
Automatically save crash details to a file when a Go desktop app crashes.
Send error reports from a backend server to a log right when a crash happens.
Capture diagnostic information from panics in production for later debugging.
| mitchellh/panicwrap | tj/triage | caddyserver/nginx-adapter | |
|---|---|---|---|
| Stars | 453 | 409 | 354 |
| Language | Go | Go | Go |
| Last pushed | 2024-04-05 | 2020-05-29 | 2026-02-15 |
| Maintenance | Dormant | Dormant | Maintained |
| Setup difficulty | easy | moderate | easy |
| Complexity | 2/5 | 2/5 | 2/5 |
| Audience | developer | developer | ops devops |
Figures from each repo's GitHub metadata at analysis time.
Just import the package in a Go project and call panicwrap.Wrap with a custom handler function.
When a program hits a fatal bug, it typically crashes and prints a messy error trace to the screen. panicwrap is a tool for programs written in Go that catches those crashes, called "panics", so the developer can do something useful with the error information before the program exits. Instead of relying on a user to copy and paste an error report, the program can automatically save the crash details to a file or send them to a log. The library works by essentially splitting the program into two parts: a parent and a child. When the application starts, panicwrap restarts the program in the background as a "child" and watches its output. The user interacts with this child process without noticing anything different. If the child process hits a fatal bug, panicwrap detects the crash, grabs the error details, and hands them to a custom function written by the developer. The program still crashes, but the developer gets to capture the diagnostic information first. This is useful for anyone building applications that run on other people's computers or remote servers. For desktop tools, it means you can automatically report crashes instead of hoping your customer manually emails you a screenshot of an error. For backend servers, it means you can write crash details to a timestamped file right when they happen, making it much easier to figure out exactly what went wrong in production. An important detail is that this tool is not designed to recover from errors or keep a crashing program running. The README is very clear that panics represent serious bugs, and the program absolutely should crash. The project simply provides a clean way to capture the crash data on the way down. Because of how it captures errors, the project's creator recommends keeping the custom handling functions simple and well-tested to avoid triggering another crash while trying to save the first one.
panicwrap is a Go library that catches fatal crashes in your program and lets you save or report the error details before the program exits. It is not for recovery, just for cleanly capturing crash data on the way down.
Mainly Go. The stack also includes Go.
Dormant — no commits in 2+ years (last push 2024-04-05).
Use freely for any purpose, including commercial use, as long as you keep the copyright notice.
Setup difficulty is rated easy, with roughly 5min to a first successful run.
Mainly developer.
This repo across BitVibe Labs
Verify against the repo before relying on details.