What is a good common term for errors and warnings?

6.5k views Asked by At

I'd like to build an OO hierarchy of errors and warnings returned to the client during a, let's say, pricing operation:

interface PricingMessage {}

interface PricingWarning extends PricingMessage {}

interface PricingError extends PricingMessage {}

class NoSuchProductError implements PricingError {
 ...
}

I'm not very keen on the name PricingMessage. What is the concept that includes errors and warnings?

EDIT: To be clear, I'm looking for a common concept or name for errors and warnings specifically (excluding e.g. general info messages). For instance, compilers also report errors and warnings. What are these?

7

There are 7 answers

0
Eric Smith On BEST ANSWER

Some suggestions...

"Result"

An operation has results, which could be some number of errors, warnings, notes and explicit or implied (no errors) success.

PricingResult

"Issue"

An operation ran, but with issues, some of which could be fatal (errors) and some of which might not be (warnings). If there are no issues, success is implied.

PricingIssue

"Condition"

An operation might have or be in an error condition or a warning condition. I think some compilers use "condition" as an abstract term for an error or warning.

PricingCondition

"Diagnostic"

The outcome of an operation might include diagnostics for errors and warnings. Another compiler term, I believe.

PricingDiagnostic
0
Pete O'Connell On

In theory these could be defined as events - so you could use that.

0
mcsilvio On

This is very subjective, but here are a few suggestions:

  • Output
  • LogEntry
6
takendarkk On

If you were dealing with java, or similar OO languages, the word you are looking for would be Exception. This indicates that you have reached an "exceptional" condition which needs to be handled in a controlled way.

1
krayzk On

I prefer the name Alert. An alert IMO can have any level of severity, it could be identified as informational, warning, critical or any other level deemed appropriate.

The counter argument I have heard to this naming is the idea that alert the noun follows too closely to alert the verb, making the distinction that the object (noun) may or many not have been brought to the users attention yet (verb). In this context naming them alert could creates a bit of cognitive dissonance, and perhaps confusion for developers reasoning about your code.

The best I can propose would be to create a hard distinction be made in your code base between Alert (the object of exceptional condition) and Notification (the act of bringing the alert to the users attention) to keep things intuitive for programmers moving forward.

0
rdb On

In web design, the term "admonition" is sometimes used for a block of text that can be an error, warning, or informational.

0
NotEnoughData On

Through looking at a few synonym lists, I found the following:

  • Anomaly, oddity, deviation
  • Alert, message, notification
  • Fault, misstep, failure, glitch