New answers tagged

8 votes
Accepted

Is throwing an error in programming is good Idea at all?

When you say 'throwing errors' I think you are talking about what most people call 'exceptions'. The wisdom of exceptions is regularly debated. One of the founders of this website has an old article ...
JimmyJames's user avatar
  • 27.3k
1 vote

Is throwing an error in programming is good Idea at all?

Its better to throw the exception because that is the built in way of returning an error response. Say you return an error json as you suggest. Then my code has to be.. var result = library.DoThing(); ...
Ewan's user avatar
  • 75.7k
2 votes

Error codes in a legacy C++ project

First of all: why you reuse system error codes? There's even more weirdness in your code with - sign. So the first step to improve your situation is to introduce your own error codes: const int ...
freakish's user avatar
  • 444

Top 50 recent answers are included