TrueBlocks / trueblocks-core

The main repository for the TrueBlocks system
https://trueblocks.io
GNU General Public License v3.0
1.04k stars 197 forks source link

Handler code should not use Fatal #3587

Closed tjayrush closed 4 months ago

tjayrush commented 4 months ago

At this line https://github.com/TrueBlocks/trueblocks-core/blob/develop/src/apps/chifra/internal/slurp/handle_show.go#L19, it says this:

    provider, err := opts.Provider()
    if err != nil {
        logger.Fatal(err)
    }

Do we want to fail fatally? In API mode, this will crash the server. I think I tried to not use Fatal because no matter what, we don't want the server to die.

Why not just return the error?

dszlachta commented 4 months ago

Sorry for that, it's Key's bad influence on me