Free-Nations-Region / CyborgianStates

A (Discord-) Bot for all needs of a Region in NationStates
MIT License
0 stars 1 forks source link

Main: Catch and Log Fatal Exceptions to Console #54

Closed drehtisch closed 4 years ago

drehtisch commented 4 years ago

Description

When starting the bot with the default config it just failed silently. Now the main method catches such fatal exceptions and write them to the Standard Error Output Stream.

Motivation and Context

The main method called Launcher.RunAsync() in a sync way. That caused the call to silently fail if a exception occured. Resulting in a crash of the bot.

Fixes: #50

This can be further improved by using actual logging and config checking for more concise error mesages before calling Launcher.RunAsync()

How Has This Been Tested?

Manually

Types of changes

Checklist:

codecov[bot] commented 4 years ago

Codecov Report

Merging #54 into master will decrease coverage by 0.38%. The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #54      +/-   ##
==========================================
- Coverage   72.18%   71.80%   -0.39%     
==========================================
  Files          21       21              
  Lines         604      610       +6     
  Branches       61       61              
==========================================
+ Hits          436      438       +2     
- Misses        164      168       +4     
  Partials        4        4              
Impacted Files Coverage Δ
CyborgianStates/Program.cs 92.30% <60.00%> (-7.70%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5d4ad61...b96aed6. Read the comment docs.