juno icon indicating copy to clipboard operation
juno copied to clipboard

Remove Panics of the app

Open stdevMac opened this issue 3 years ago • 3 comments

Describe the bug Each time the app encounters an error that we should not recover, instead of Panic, and printing all the stack traces, we should handle that error, print an Error log, and close properly the app.

There should not exist panic,

stdevMac avatar Jun 19 '22 17:06 stdevMac

As per as #264 it would be nice to extend a config env variable (eg. juno_env="prod") so zap dpanic can be used. Panic behaviour is different whether the logger is initiated with a "development" or a "production" setting. Documentation says: DPanic stands for "panic in development." In development, it logs at PanicLevel; otherwise, it logs at ErrorLevel. DPanic makes it easier to catch errors that are theoretically possible, but shouldn't actually happen, without crashing in production.

This would highly improve logging. Dpanic would then be used where panic might be needed (mainly at bootstrap) and enforce some rules in the CI/CD making sure that panic() is not being used.

v4lproik avatar Jul 05 '22 10:07 v4lproik

That sounds great! if you want to take a look at that is more than welcome!

stdevMac avatar Jul 05 '22 10:07 stdevMac

Alright! I'll get on with it then!

v4lproik avatar Jul 05 '22 10:07 v4lproik