mkropat / betterwin32errors Goto Github PK
View Code? Open in Web Editor NEWA better interface to the constants defined in winerror.h
License: MIT License
A better interface to the constants defined in winerror.h
License: MIT License
Hi @mkropat
This little nuget package is very very useful. I'm creating a "batch" (console app) framework that makes it easier for our developers to write such apps and be sure of solid support for exceptions etc, the framework makes it easy for a developer to now return one of your error codes (ultimately returned from Main) returning error codes is very important for console apps that are started by a scheduler or SQL server where the return code is leveraged.
It would be great to add the 'Description' attribute to each enum entry, where the text is simply the same as the existing comments.
Of course there are over 6,000 entries so this could be done piece meal, with periodic pull requests that simply add these gradually to the set.
I'd be happy to start this if you think it's something you'd like to see, e.g.
//
// Summary:
// The operation completed successfully.
ERROR_SUCCESS = 0,
becomes
//
// Summary:
// The operation completed successfully.
[Description("The operation completed successfully.")]
ERROR_SUCCESS = 0,
We could then add a simple static class and method to get this text for any enum value (defaulting to just the enum name if there is not yet a Description attribute for it).
Doing this here on the root repo is ideal too because with so many entries having multiple developers doing this would make it quicker overall.
I did something very similar once - in C - and had the description text too, being able to report that text was very very useful.
PS: Its tempting too to define an alias enum for ERROR_SUCCESS named simply SUCCESS...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.