Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 34360

C# is a multiparadigm, managed, garbage-collected object-oriented programming language created by Microsoft in parallel with the .NET platform

7 votes

What are good ways of balancing informative exceptions and clean code?

Microsoft seems to (via looking at the .NET source) sometimes use resource/Environment strings. For example, ParseDecimal: throw new OverflowException(Environment.GetResourceString("Overflow_Decimal …
zastrowm's user avatar
  • 308
1 vote

What are good ways of balancing informative exceptions and clean code?

[note] I copied this from the question into an answer in case there are comments about it. Move each exception into a method of the class, taking in any arguments that need the formatting. private …
zastrowm's user avatar
  • 308
12 votes
8 answers
2k views

What are good ways of balancing informative exceptions and clean code?

With our public SDK, we tend to want to give very informative messages about why an exception occurs. For example: if (interfaceInstance == null) { string errMsg = string.Format( "Con …
zastrowm's user avatar
  • 308