Skip to content

Reorganized src for ReCap.Server#8

Merged
vitor251093 merged 2 commits into
mainfrom
source-reorg
Mar 4, 2026
Merged

Reorganized src for ReCap.Server#8
vitor251093 merged 2 commits into
mainfrom
source-reorg

Conversation

@Splitwirez

@Splitwirez Splitwirez commented Jun 9, 2025

Copy link
Copy Markdown
Contributor

Don't merge yet - still needs regression testing. Input wanted.

  • Thoughts so far, overall?
  • Why does the BlazeCredentials class exist? (it isn't even used anywhere, as far as I can tell...)
  • Why do we have UnimplementedMethodException, instead of just using NotImplementedException?

@Splitwirez Splitwirez requested a review from vitor251093 June 9, 2025 17:32
Comment thread ReCap.Server/Adapters/Blaze/Component/Shared.cs
Comment thread ReCap.Server/Config/BlazeCredentials.cs
@vitor251093

Copy link
Copy Markdown
Contributor

Thoughts so far, overall?

Other than the open comment above, all good :)

Why does the BlazeCredentials class exist? (it isn't even used anywhere, as far as I can tell...)

The Blaze implementation isn't finished yet, but, once it's, we will need those credentials to establish the communication between Darkspore and the server.

Why do we have UnimplementedMethodException, instead of just using NotImplementedException?

Because NotImplementedException inherits SystemException, and, according to MS docs about SystemException:

This class is provided as a means to differentiate between system exceptions and application exceptions. It is the base class of such exceptions as ArgumentException, FormatException, and InvalidOperationException.

Because SystemException serves as the base class of a variety of exception types, your code should not throw a SystemException exception, nor should it attempt to handle a SystemException exception unless you intend to re-throw the original exception.

In other words, that exception is reserved for the system to use.

@Splitwirez

Splitwirez commented Jul 12, 2025

Copy link
Copy Markdown
Contributor Author

@vitor251093


Splitwirez: Thoughts so far, overall?

vitor251093: Other than the open comment above, all good :)

Oh good :D


Splitwirez: Why does the BlazeCredentials class exist? (it isn't even used anywhere, as far as I can tell...)

vitor251093: The Blaze implementation isn't finished yet, but, once it's, we will need those credentials to establish the communication between Darkspore and the server.

Right...so, should the BlazeCredentials class itself be made static, or...?


Splitwirez: Why do we have UnimplementedMethodException, instead of just using NotImplementedException?

vitor251093: Because NotImplementedException inherits SystemException, and, according to MS docs about SystemException:

learn.microsoft.com: This class is provided as a means to differentiate between system exceptions and application exceptions. It is the base class of such exceptions as ArgumentException, FormatException, and InvalidOperationException.
Because SystemException serves as the base class of a variety of exception types, your code should not throw a SystemException exception, nor should it attempt to handle a SystemException exception unless you intend to re-throw the original exception.

In other words, that exception is reserved for the system to use.

While the quoted paragraph says the SystemException class is reserved and shouldn't be thrown or handled by us, it doesn't say anything about derived classes such as NotImplementedException.

In fact, when prompted to generate missing stuff for an interface implementation, both Visual Studio and VSCode produce method implementations which throw a NotImplementedException.

Furthermore, the documentation for NotImplementedException - in particular, the supplemental API remarks for NotImplementedException - actively encourage it to be thrown by in-development code, such as ours.

So uh...can I change us over to use NotImplementedException?

EDIT: NotSupportedException also exists. Should we use that instead?

@vitor251093 vitor251093 merged commit 84d0969 into main Mar 4, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants