Juerr is a Java port of the uerr crate, it provides stunning visual error handling.

Overview

Juerr

Juerr is a Java port of the uerr crate, it provides stunning visual error handling.

Showcase

Using the code below, we can display a simple error and show it to the user.

import me.ikevoodoo.juerr.UserError;

public class ErrorTest {
    public static void main(String[] args) {
        UserError.from("could not open file")
                .addReason("The system cannot find the file specified.")
                .addHelp("Does this file exist?")
                .printAll("juerr/error: ");
    }
}

Output

juerr/error: could not open file
 - caused by: The system cannot find the file specified.
 + help: Does this file exist?

With multiple arguments

import me.ikevoodoo.juerr.UserError;

public class ErrorTest {
    public static void main(String[] args) {
        UserError.from("could not open file")
                .addReason("The system cannot find the file specified.")
                .addReason("Fillter reason")
                .addHelp("Does this file exist?")
                .addHelp("Filler help.")
                .printAll("program.jar: ");
    }
}

Output

program.jar: could not open file
 - caused by: The system cannot find the file specified.
     |        Filler reason.
 + help: Does this file exist?
     |   Filler help.

Running and auto catching exceptions

import me.ikevoodoo.juerr.UserError;

import java.io.IOException;
import java.nio.file.Files;

public class ErrorTest {
    public static void main(String[] args) {
        UserError.from(ErrorTest::myFunction).ifPresent(err -> err.printAll("myFunction: "));
    }

    public static void myFunction() throws IOException {
        Files.readAllBytes(null);
    }
}

Output (if an exception was thrown)

myFunction: Any error that was raised

Running and generating error (WIP)

import me.ikevoodoo.juerr.UserError;

import java.io.IOException;
import java.nio.file.Files;

public class ErrorTest {
    public static void main(String[] args) {
        UserError.fromStacktrace(ErrorTest::myFunction).ifPresent(err -> err.printAll("myFunction: "));
    }

    public static void myFunction() throws IOException {
        Files.readAllBytes(null);
    }
}

Output (if an exception was thrown)

| Check where path is assigned">
Could not read file: Cannot invoke "java.nio.file.Path.getFileSystem()" because "path" is null
 - caused by: java.nio.file.Files.provider(Files.java:105)
     |        java.nio.file.Files.newByteChannel(Files.java:380)
     |        java.nio.file.Files.newByteChannel(Files.java:432)
     |        java.nio.file.Files.readAllBytes(Files.java:3289)
     |        me.ikevoodoo.ErrorTest.main(UserError.java:178)
 + help: Try checking if path is not null
     |   Try wrapping path in a Optional<Path>
     |   Check where path is assigned

Uncaught exceptions

import me.ikevoodoo.juerr.UserError;

import java.io.IOException;
import java.nio.file.Files;

public class ErrorTest {
    public static void main(String[] args) throws IOException {
        UserError.setExceptionHandler(); // Sets the thread's uncaught exception handler
        ProjectInfo.load(ErrorTest.class); // Load your project

        Files.readAllBytes(null);
    }
}

Output

[Thread main] Uncaught: null
 - caused by: java.nio.file.Files.provider(Files.java:97)
     |        java.nio.file.Files.newByteChannel(Files.java:361)
     |        java.nio.file.Files.newByteChannel(Files.java:407)
     |        java.nio.file.Files.readAllBytes(Files.java:3152)
     |        me.ikevoodoo.ErrorTest.main(Test.java:11)

Maven

coming soon

Gradle

coming soon
You might also like...

Kotlin/LibGDX port of my Unity 2D Sandbox

TileRPG Kotlin port/continuation of my Unity TileRPG game, which was in itself a rewrite of my first attempt at making a 2D sandbox game. A libGDX pro

Jan 23, 2022

Provides a simple java application for managing internationall football teams, players, coaches and matches.

Provides a simple java application for managing internationall football teams, players, coaches and matches.

Internationall football team manager application Provides a simple java application for managing internationall football teams, players, coaches and m

Feb 7, 2022

An API Library that provides the functionality to access, manage and store device topologies found in JSON files using Java and Maven Framework

An API Library that provides the functionality to access, manage and store device topologies found in JSON files using Java and Maven Framework

Topology API πŸ“™ About An API library which provides the functionality to access, manage and store device topologies. πŸ“ Description Read a topology fr

Aug 4, 2022

Dynamically filters JPA entities with a simple query syntax. Provides JPA/Hibernate predicates and Spring Data specifications.

Spring Filter You need a way to dynamically filter entities without any effort? Just add me to your pom.xml. Your API will gain a full featured search

Dec 13, 2022

Provides some Apple Wallet functionality, like adding passes, removing passes and checking passises for existing.

Provides some Apple Wallet functionality, like adding passes, removing passes and checking passises for existing.

react-native-wallet-manager Provides some Apple Wallet's functionality, like adding passes, removing passes and checking passises for existing. Instal

Nov 12, 2022

The state-of-the-art Dashboard of Apache RoccketMQ provides excellent monitoring capability. Various graphs and statistics of events, performance and system information of clients and application is evidently made available to the user.

RocketMQ Dashboard How To Install With Docker get docker image mvn clean package -Dmaven.test.skip=true docker:build or docker pull apacherocketmq/ro

Dec 30, 2022

Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.

Spring Cloud Alibaba A project maintained by Alibaba. See the δΈ­ζ–‡ζ–‡ζ‘£ for Chinese readme. Spring Cloud Alibaba provides a one-stop solution for distribut

Jan 1, 2023

The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types.

Apache Commons CSV The Apache Commons CSV library provides a simple interface for reading and writing CSV files of various types. Documentation More i

Dec 26, 2022

This app corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

This app corrects your sitting posture and provides feedback in real time in conjunction with the app. A sensor of 31 cells detects your posture to get better life-wellness

Notichair μ‹€μ‹œκ°„ μžμ„ΈλΆ„μ„ 및 ꡐ정 μŠ€λ§ˆνŠΈμ²΄μ–΄ πŸ† 상λͺ…λŒ€ν•™κ΅ PRIME κ²½μ§„λŒ€νšŒ μˆ˜μƒ πŸ† μš”κ΅¬μ‚¬ν•­ 31-cell sensor (mdxs-16-5610) λͺ©μ°¨ 1. μ†Œκ°œ ν”„λ‘œμ νŠΈ λ‚΄μš© μ†Œκ°œ 2. 개발 ν™˜κ²½ 사전 μ„€μ • 및 ν™˜κ²½ ꡬ좕 3. κΈ°λŠ₯ Sensors Ap

Jan 15, 2022
Comments
  • Added more portability

    Added more portability

    Some of java utils require throwable class instead of Exception class, so I changed this. Also added thread uncaught exception handler, so developers don't need to try/catch entire their code to get beatiful messages

    opened by SashaSemenishchev 0
Owner
IkeVoodoo
Cheese is good
IkeVoodoo
A visual implementation of OSHI, to view information about the system and hardware.

MooInfo A visual implementation of OSHI, to view information about the system and hardware. Such as OS, processes, memory, CPU, disks, devices, sensor

周泒 104 Jan 6, 2023
Public documentation for Visual Studio Code

Visual Studio Code Documentation You've found the Visual Studio Code documentation GitHub repository, which contains the content for the Visual Studio

Microsoft 4.8k Jan 8, 2023
Doing red/green/refactor with quick and visual feedback loop on your Nanoleaf

nanoleaf-intellij-plugin Want fancy coloured and visual quick feedback for your tests? Install the Nanoleaf IntelliJ plugin. The plugin listen to your

Baptiste Lecocq 5 Dec 27, 2022
Error monitor for Spring Boot

Error monitor for Spring Boot

ZJ 13 Sep 23, 2022
Rails like error pages for Spring Boot applications that are only active in development.

Better Error Pages Table of Contents Introduction Demo Quick Start Configuration Limitations License Introduction This is a Spring Boot Starter projec

Kod Gemisi 13 Jan 2, 2022
UMS is a CRUD based management system which uses File Handling to manipulate data and perform the CRUD operations

UMS is a CRUD (Create, Read, Update, Delete) based management system which uses File Handling to manipulate data and perform the CRUD operations. It is a group project made using Java procedural programming having both User and Admin sides.

Daoud-Hussain 9 Dec 20, 2022
Get or Throw Spring boot Starter will help you to hide handling if entity not found.

Get or Throw Spring boot Starter Get or Throw Spring boot Starter will help you to hide handling if entity not found. 1. Setup 2. Usage Library adds c

null 3 Feb 2, 2022
An OpenHIM mediator for handling system integration between HRHIS and NHIF

Tanzania HRHIS - NHIF Mediator An OpenHIM mediator for handling system integration from HRHIS to NHIF. Getting Started Clone the repository and run np

Softmed Tehnologies 2 Oct 19, 2021
NotEnoughEnergistics is a port of Just Enough Energistics to Minecraft 1.7.10

δΈ­ζ–‡ Not Enough Energistics NotEnoughEnergistics is a port of Just Enough Energistics to Minecraft 1.7.10 This mod replaces AE2's default NEI integratio

vfyjxf 12 Oct 30, 2022
COMPortNotifier - Smol utility to send you a notification every time you connect, or disconnect a COM port.

COMPortNotifier A smol utility that sends you a notification every time a COM port is connected, or disconnected on your computer. Useful for electric

Matt Foulks 1 Sep 7, 2022