Skip to content

Commit

Permalink
Merge branch 'main' of github.com:propensive/fulminate
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Feb 27, 2024
2 parents 4b8fe8b + 4589cba commit 75e54fe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,21 @@ If the compiler is running in a terminal with color capability, then color will
be used to highlight embeddings in the failure message, by including ANSI
escape codes in the output message.

### `Mistake`
Calling `fail` requires a contextual `Realm` in scope. A `Realm` does nothing
more than to give a name to the scope for communication, and can be created with:
```scala
given Realm = realm"myproject"
```

### `Panic`

Sometimes we need to raise exceptions which are not intended to be handled, and
not even intended to be thrown, for example when a code branch is run which
should be impossible to reach. The `Mistake` class provides a standard way of
should be impossible to reach. The `Panic` class provides a standard way of
handling such situation, and takes a `Message` parameter which should briefly
explain the reason why the situation was believed to be impossible.

Should a `Mistake` be thrown, it should represent a programming mistake: the
Should a `Panic` be thrown, it should represent a programming mistake: the
manifestation of a misconception of impossibility on the part of the
programmer.

Expand All @@ -126,7 +132,7 @@ as long as caution is taken to avoid a mismatch between the project's stability
level and the required stability and maintainability of your own project.

Fulminate is designed to be _small_. Its entire source code currently consists
of 166 lines of code.
of 164 lines of code.

## Building

Expand Down

0 comments on commit 75e54fe

Please sign in to comment.