Starcounter / Starcounter.ErrorCodes

Errorcodes for all Starcounter versions.
0 stars 0 forks source link

Create concrete implementations of the exceptions #37

Closed Mackiovello closed 6 years ago

Mackiovello commented 6 years ago

In Nova, when receiving an exception for Starcounter.QueryProcessor, which uses Starcounter.ErrorCodes, you get a System.Exception, no matter what exception is actually thrown. This exception, in turn, has a message with the actual exception, such as:

System.Exception: ScErrNoTransactionAttached (SCERR4003): Operation must be performed in the context of a valid transaction

It would be great if Starcounter.ErrorCodes had concrete classes of these exceptions so that the packages consuming them, such as Starcounter.QueryProcessor, could throw the actual exception instead of System.Exception and make it easier for others to catch and handle these exceptions.

Is this reasonable?

chrhol commented 6 years ago

Yes that makes a lot of sense. We discussed this quite some time ago and decided that all .net codehosts need to share the same exceptions and have the proper exception created based on errorcode.

The task was assigned to me (https://github.com/Starcounter/level1/issues/4272), I started it, but never finished it 😢

Lets up the priority again now that we're trying to get Nova up and running for real.

Mackiovello commented 6 years ago

Okay, let's keep the original issue in Starcounter/level1#4272 and close this one.

It's not super urgent, but it would definitely make Nova development and maintenance easier.