GithubHelp home page GithubHelp logo

mkropat / betterwin32errors Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 3.0 12 KB

A better interface to the constants defined in winerror.h

License: MIT License

C# 51.48% PowerShell 46.03% Batchfile 2.49%
error interop pinvoke win32api

betterwin32errors's People

Contributors

ied206 avatar mkropat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

betterwin32errors's Issues

Suggestion - Support 'Description' attribute

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...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.