What is a good general term for errors and warnings?

I would like to create a hierarchy of OO errors and warnings returned to the client during, say, a price operation:

interface PricingMessage {} interface PricingWarning extends PricingMessage {} interface PricingError extends PricingMessage {} class NoSuchProductError implements PricingError { ... } 

I do not really like the name PricingMessage . What is the concept of errors and warnings?

EDIT. To be clear, I am looking for a general concept or name for errors and warnings (excluding, for example, general informational messages). For example, compilers also report errors and warnings. What is it?

+6
source share
6 answers

If you were dealing with java or similar OO languages, the word you are looking for would be Exception . This means that you have reached an “exceptional” state that must be controlled in a controlled manner.

+3
source

Looking through a few synonyms , I found the following:

  • Anomaly, strangeness, deviation
  • Warning, Message, Notification
  • Malfunction, error, failure, failure
+2
source

Some suggestions ...

"Result"

The operation has results, which can be a number of errors, warnings, notes, and obvious or implied (without errors) success.

 PricingResult 

"Problem"

The operation was performed, but with problems, some of which may be fatal (errors), and some of which may be (warnings). If there are no problems, success is implied.

 PricingIssue 

"Condition"

The operation may or may not have an error condition or warning condition. I think some compilers use the “condition” as an abstract term for error or warning.

 PricingCondition 

"Diagnostic"

The result of the operation may include the diagnosis of errors and warnings. I believe that another compiler.

 PricingDiagnostic 
+2
source

In theory, they can be defined as events - so you can use this.

0
source

This is very subjective, but here are some tips:

  • Output
  • Logentry
0
source

I prefer the name Alert . Prevention IMO can have any level of criticality, it can be defined as informational, warning, critical or any other level that is considered appropriate.

The argument of the counter that I heard during this naming is the idea that the warning that the noun should be too close to warn the verb, making the difference that the object (noun) may or may not have been brought to the attention of users ( verb). In this context, calling them a warning, you can create a bit of cognitive dissonance and possibly confusion for developers talking about your code.

The best I can offer is to create a tough distinction in your code base between Alert (an object of an exceptional state) and Notification (an act of drawing attention to the attention of users) in order to keep things intuitive for programmers moving forward.

0
source

All Articles