mirror of
https://github.com/tgdrive/teldrive.git
synced 2025-09-14 10:25:39 +08:00
feat: Add panic recovery to application
This commit is contained in:
parent
bde8806a52
commit
75e7b6317b
1 changed files with 7 additions and 0 deletions
|
@ -132,6 +132,13 @@ func runApplication(conf *config.Config) {
|
|||
controller.NewController,
|
||||
),
|
||||
)
|
||||
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
logging.FromContext(context.TODO()).Errorf("Recovered from panic: %v", r)
|
||||
}
|
||||
}()
|
||||
|
||||
app.Run()
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue