Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Add] Neo Build Error Base - Part 2 #3730

Conversation

cschuchardt88
Copy link
Member

@cschuchardt88 cschuchardt88 commented Feb 9, 2025

Blocks

Change Log

  • Added NeoBuildException.cs file.
  • Added INeoBuildException.cs file.

Type of change

  • Optimization (the change is only an optimization)
  • Style (the change is only a code style for better maintenance or standard purpose)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@cschuchardt88 cschuchardt88 added Blocked This issue can't be worked at the moment Waiting for Review labels Feb 9, 2025

namespace Neo.Build.Core.Exceptions
{
internal interface INeoBuildException
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

abstract class : Exception ?

Copy link
Member Author

@cschuchardt88 cschuchardt88 Feb 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this CAN BE used the same way as Exception class. My initial R&D did what your requesting. It didnt turn out very good after a while. Because we no longer using dotnet known exceptions. Plus that is why I added an interface.

You only use abstract class if you are defining common processing of data, not defining it.

Interface == define data
abstract == define code redundancy

Copy link
Member

@shargon shargon Feb 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then better to rename it to INeoBuildError because it's not an exception @cschuchardt88

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is an exception. You use throw to throw the exception.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't throw an interface, so it's not an exception

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, The interface is to be used to let us know that the exception is ours. It we throw base exception and do if (something is exception e) we wouldn't know if its neo-build caught exception or code bug. Helps with other stuff too. You will see soon, what I'm talking about. If it ends up not being useful, than it will be removed. I'm just putting this stuff in the repo and doing a couple of files to, so the team can help develop, if they wish and making the review process easier then 100+ files at once. This is why I created neo-build branch. Nothing is set in stone.

@cschuchardt88 cschuchardt88 added the Blocker Issues that are blocking other issues. Check issues details to see what it is blocking. label Feb 10, 2025
@cschuchardt88 cschuchardt88 self-assigned this Feb 10, 2025
@cschuchardt88 cschuchardt88 changed the title [Add] Neo Build Error Base [Add] Neo Build Error Base - Part 2 Feb 11, 2025
@cschuchardt88 cschuchardt88 removed the Blocked This issue can't be worked at the moment label Feb 12, 2025
@shargon shargon merged commit 785506b into neo-project:neo-build Feb 13, 2025
6 checks passed
@shargon shargon deleted the neo-build/Neo.Build.Core/add/exceptions/base branch February 13, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Blocker Issues that are blocking other issues. Check issues details to see what it is blocking. Neo Build Waiting for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants