-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreadme
More file actions
43 lines (36 loc) · 2.25 KB
/
readme
File metadata and controls
43 lines (36 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#  Crash Proof Go Apps
[](https://github.com/codemodify/systemkit-crashproof/releases/latest)


[](https://github.com/codemodify/TheFreeLicense)


[](https://goreportcard.com/report/github.com/codemodify/systemkit-crashproof)
[](https://godoc.org/github.com/codemodify/systemkit-crashproof)






### What it offers
- The one and only crash proofing mechanics for your Go app.
- Catches crashes/panics deep into your concurrent code
- What's the catch: DON'T use `go func(){}()`, use `crashproof.Go(func(){})` as in setup below
### Sample
```go
func main() {
crashproof.ConcurrentCodeCrashCatcher = reportCrash
crashproof.RunAppAndCatchCrashes(func() {
...
// YOUR CONCURRENT APP HERE
crashproof.Go(func(){
panic("OOPS")
})
...
})
}
func reportCrash(err interface{}, packageName string, callStack []crashproof.StackFrame) {
fmt.Fprintf(os.Stderr, "\n\nCRASH: %v\n\npackage %s\n\nstack: %v\n\n", err, packageName, callStack)
}
```