Home

Awesome

cognitect.anomalies

Rationale

Anomalies capture errors as information that is simple, actionable, generic, and extensible.

Anomalies overlap in purpose with e.g. Java exceptions and HTTP responses. The differences are instructive:

Java exceptions are not simple, as they combine error information with a flow control mechanism. This is a problem in e.g. async applications and transductions. Both of these contexts need to talk about errors, but do not want to utilize exceptions' flow control by stack unwinding.

HTTP responses provide useful partitioning via status codes. But since status codes appear inside a server response they cannot possibly cover e.g. failure to get a response at all.

The Categories

The category column contains the name of an anomaly category within the cognitect.anomalies namespace.

The retry column is "yes" if a replay of the same activity might reasonably lead to a different outcome. When a program encounters a retryable anomaly, it may be reasonable to back off and try again.

The "fix" column provides an example of how a programmer or operator might fix problems in this category.

The "song" column contains a Hall and Oates song. The idea that Hall and Oates are software gurus is controversial in some circles, so you can treat this as flavortext.

categoryretryable?fixsong
:unavailableyesmake sure callee healthyOut of Touch
:interruptedmaybestop interruptingIt Doesn't Matter Anymore
:busyyesbackoff and retryWait For Me
:incorrectnofix caller bugYou'll Never Learn
:forbiddennofix caller credsI Can't Go For That
:unsupportednofix caller verbYour Imagination
:not-foundnofix caller nounShe's Gone
:conflictnocoordinate with calleeGive It Up
:faultmaybefix callee bugFalling

Using cognitect.anomalies

Leiningen dependency information:

[com.cognitect/anomalies "0.1.12"]

Maven dependency information:

<dependency>
  <groupId>com.cognitect</groupId>
  <artifactId>anomalies</artifactId>
  <version>0.1.12</version>
</dependency>

Developer Information

Please submit feedback via GitHub issues.

Please do not submit pull requests or patches.

Copyright and License

Copyright (c) Cognitect, Inc. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

 http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS-IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.