Skip to content

Removal of Fatal(s) to enable deferred calls execution

Pavlo Strokov requested to merge ps-omit-fatal into master

The log.Fatal function executes os.Exit(1) under the hood and terminates binary immediately without running any finalisation. So all deferred function calls won't run and could lead to problems with available volume, file structure, etc.
We replace usages of it with panic or something else applicable in the context and do some refactoring of the service initialisation by moving initialisations inside of the func and returning an error from it instead of calling Fatal.

Merge request reports

Loading