stride3d / stride3d/stride

Easy One - Avoid Exception when AppSettings File is missing

Open
#1,399 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Here's a quick code change that I'd like to submit to Stride codebase -- just a few lines of code, to eliminate a pointless FileNotFound Exception at startup, from calling "YamlSerializer.Load".

Here's the code "as is now" from AppSettingsProvider:

image

Here's the code after I edited it:

image

What I did matches how it's done from the only other place in code that we call this method, where the File.Exists is checked beforehand to avoid using Exception for Program Flow:

image

So this just requires a few lines of code to change, and poof, it behaves the SAME but avoid throwing an exception.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Find AppSettingsProvider and inspect its call to YamlSerializer.Load; compare it with the other call site mentioned in the issue, where File.Exists is checked first. Confirm that startup with a missing app-settings file behaves the same without raising a FileNotFoundException.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.