-
Notifications
You must be signed in to change notification settings - Fork 1k
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 Definition - Part 1
#3728
Merged
shargon
merged 12 commits into
neo-project:neo-build
from
cschuchardt88:neo-build/Neo.Build.Core/add/error-codes
Feb 11, 2025
Merged
[Add
] Neo Build Error Definition - Part 1
#3728
shargon
merged 12 commits into
neo-project:neo-build
from
cschuchardt88:neo-build/Neo.Build.Core/add/error-codes
Feb 11, 2025
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 tasks
….Core/add/error-codes
…eo-build/Neo.Build.Core/add/error-codes
Add
] Neo Build Error DefinitionAdd
] Neo Build Error Definition - Part 1
shargon
approved these changes
Feb 11, 2025
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Blocks
Add
] Neo Build Error Base - Part 2 #3730Add
] File Not Found Exception - Part 3 #3734Add
] File Denied Exception - Part 3 #3733Error Codes
are used when an
Exception
is thrown, to identify known issues with building, deploying or testing project's*.nbproj
file orMSBuild
tasks withinVisual Studio
ordotnet
CLI.How to use Error Codes
When an
Exception
occurs (whether that be known or unknown) the number MUST BE set to the exception'sHResult
property. Doing so, will set the exit code of the application. Exit codes are used by many applications within the Neo Build Engine process. These codes are also used as an error string ID for exceptionMessage
property, to help the user identify the root of the problem. Error string will be prefixed withNB
and have a suffix format of{0:d04}
, for example:NB1000
,NB0101
,NB0070
. This allows padding of zeros for anything less than1000
.Module Filename Format
will be defined as
NeoBuildErrorCodes.{module}.cs
withinNeo.Build.Core
library. For example:NeoBuildErrorCodes.Wallet.cs
file would hold all the error codes for the wallet module. See What is a Module for more details.What is a Module
refers to the part of code doing the processing within the Neo Build Engine for example,
NeoBuildEngine::Wallet:Open()
.Wallet
is the module. Each class SHOULD BE considered it's own module. Each subclass in the module class that hasprivate
orinternal
WILL NOT be considered a different module for example,NeoBuildEngine::Wallet::Cache:AddItem()
.How to Define Module Base
Each module within Neo Build Engine has it own base error number. These modules can hold up to
1000
known errors each. The formula for calculating an error module's base ismb = b * (n + 1)
; build engine's module base number (b
) times number (n
) of modules plus one (1
) equals module base (mb
).Factors
1000
to9999
.HResult
property inSystem.Exception
with error code number.Message
property inSystem.Exception
with root cause of the error.Example
Type of change
Checklist: