Skip to content

Commit bdbd029

Browse files
committed
Revert "add first implementation of a function generating a crash-report"
This reverts commit e539837.
1 parent e539837 commit bdbd029

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

main.go

-21
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,6 @@ func main() {
111111
os.Exit(0)
112112
}
113113

114-
// function used to save panic to a file (WIP)
115-
defer panicToFile()
116-
117114
// Launch main loop in a goroutine
118115
go loop()
119116

@@ -151,24 +148,6 @@ func main() {
151148
Systray.Start()
152149
}
153150

154-
func panicToFile() {
155-
if r := recover(); r != nil {
156-
fileName := "crashreport_" + time.Now().Format("20060102150405") + ".txt"
157-
currDir, err := osext.ExecutableFolder()
158-
if err != nil {
159-
panic(err)
160-
}
161-
162-
crashreport := []byte("stacktrace from panic: \n" + string(debug.Stack()))
163-
164-
err = ioutil.WriteFile(filepath.Join(currDir, fileName), crashreport, 0644)
165-
if err != nil {
166-
panic(err)
167-
}
168-
panic(r)
169-
}
170-
}
171-
172151
func copyExe(from, to string) error {
173152
data, err := ioutil.ReadFile(from)
174153
if err != nil {

0 commit comments

Comments
 (0)