Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a good common term for errors and warnings?

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?

like image 570
sandris Avatar asked Jan 16 '14 16:01

sandris


People also ask

What is error and warning?

Errors report problems that make it impossible to compile your program. GCC reports errors with the source file name and line number where the problem is apparent. Warnings report other unusual conditions in your code that may indicate a problem, although compilation can (and does) proceed.

What is the difference between an error and a warning in your code?

An error in MySQL informs you that you actually did something wrong, describes the problem, and stops the process or query. A warning will not stop anything, but is there to tell you that something happened that is not expected (or there may be a potential issue) and it's not critical enough to terminate.

What is error message explain with example?

An error message is a message displayed to the user by an operating system or application when an unexpected condition happens. In most cases, error messages are displayed with the help of dialog boxes by the operating system or application.


4 Answers

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
like image 70
Eric Smith Avatar answered Dec 17 '22 19:12

Eric Smith


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.

like image 25
takendarkk Avatar answered Dec 17 '22 18:12

takendarkk


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

  • Anomaly, oddity, deviation
  • Alert, message, notification
  • Fault, misstep, failure, glitch
like image 38
NotEnoughData Avatar answered Dec 17 '22 19:12

NotEnoughData


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.

like image 37
krayzk Avatar answered Dec 17 '22 19:12

krayzk