Skip to content

Commit

Permalink
Bump version. Update README and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
RezzedUp committed Jul 1, 2021
1 parent eeaeed5 commit 24e0aee
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 5 deletions.
51 changes: 48 additions & 3 deletions README.md
@@ -1,10 +1,55 @@
# Exceptional

[![](https://img.shields.io/badge/License-MPL--2.0-blue)](./LICENSE "Project license: MPL-2.0")
[![](https://img.shields.io/badge/Java-11-orange)](# "This project targets Java 11")
[![](https://img.shields.io/maven-central/v/com.rezzedup.util/exceptional?color=ok&label=Maven%20Central)](https://search.maven.org/artifact/com.rezzedup.util/exceptional "Maven Central")
[![](https://img.shields.io/badge/License-MPL--2.0-blue)](./LICENSE "Project License: MPL-2.0")
[![](https://img.shields.io/badge/Java-11-orange)](# "Java Version: 11")
[![javadoc](https://javadoc.io/badge2/com.rezzedup.util/exceptional/javadoc.svg?label=Javadoc&color=%234D7A97)](https://javadoc.io/doc/com.rezzedup.util/exceptional "View Javadocs")

Utilities for handling exceptions.

```java
List<String> lines = Attempt.ignoring(() -> Files.readAllLines(Path.of("example.txt"))).orElseGet(List::of);
```

## Maven

*`Coming soon!`*
```xml
<dependency>
<groupId>com.rezzedup.util</groupId>
<artifactId>exceptional</artifactId>
<version><!--release--></version>
</dependency>
```

### Versions

Find available versions on the releases page of this repository.

Maven Central: https://search.maven.org/artifact/com.rezzedup.util/exceptional

<details id="note-snapshot-versions">
<summary><b>Note:</b> <i>Snapshot Versions</i></summary>

> [ℹ️](#note-snapshot-versions)
> Snapshot releases are available at the following repository:
>
> ```xml
> <repositories>
> <repository>
> <id>ossrh-snapshots</id>
> <url>https://s01.oss.sonatype.org/content/repositories/snapshots</url>
> </repository>
> </repositories>
> ```
</details>
### Documentation

Javadoc: https://javadoc.io/doc/com.rezzedup.util/exceptional

### Shading

If you intend to shade this library, please consider **relocating** the packages
to avoid potential conflicts with other projects. This library also utilizes
nullness annotations, which may be undesirable in a shaded uber-jar. They can
safely be excluded, and you are encouraged to do so.
2 changes: 1 addition & 1 deletion pom.xml
Expand Up @@ -6,7 +6,7 @@

<groupId>com.rezzedup.util</groupId>
<artifactId>exceptional</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.1.0-SNAPSHOT</version>

<name>Exceptional</name>
<inceptionYear>2021</inceptionYear>
Expand Down
Expand Up @@ -22,7 +22,7 @@ public class AttemptTests

private void throwsChecked() throws Exception { throw new Exception(); }

private void expect(String message) { for (int i = 0; i < 3; i++) { System.err.println(message); } }
private void expect(String message){ for (int i = 0; i < 3; i++) { System.err.println("\n" + message + "\n"); } }

@Test
public void testIgnoring()
Expand All @@ -41,6 +41,8 @@ public void testPrinting()
Optional<Integer> divided = assertDoesNotThrow(() -> Attempt.printing(this::divideByZero));
assertTrue(divided.isEmpty());

expect("THESE STACKTRACES ARE EXPECTED.");

assertDoesNotThrow(() -> Attempt.printing(this::throwsChecked));

expect("NO MORE STACKTRACES ARE EXPECTED.");
Expand Down

0 comments on commit 24e0aee

Please sign in to comment.