Better error messages for axum framework.

Related tags

Utilities axum-debug
Overview

License Crates.io Docs - Master Docs - Stable

axum-debug

This is a debugging crate that provides better error messages for axum framework.

axum is a great framework for developing web applications. But when you make a mistake, error messages can be really complex and long. It can take a long time for you to figure out what is wrong in your code. This crate provides utilities to generate better error messages in case you make a mistake.

Usage example

Will fail with a better error message:

use axum::{handler::get, Router};
use axum_debug::{debug_handler, debug_router};

#[tokio::main]
async fn main() {
    let app = Router::new().route("/", get(handler));

    debug_router!(app);

    axum::Server::bind(&"0.0.0.0:3000".parse().unwrap())
        .serve(app.into_make_service())
        .await
        .unwrap();
}

#[debug_handler]
async fn handler() -> bool {
    false
}

Safety

This crate uses #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

Performance

Macros in this crate have no effect when using release profile. (eg. cargo build --release)

License

This project is licensed under the MIT license.

You might also like...
A git prepare-commit-msg hook for authoring commit messages with GPT-3.

gptcommit A git prepare-commit-msg hook for authoring commit messages with GPT-3. With this tool, you can easily generate clear, comprehensive and des

Easily add emojis to your git commit messages 😎
Easily add emojis to your git commit messages 😎

gimoji A CLI tool that makes it easy to add emojis to your git commit messages. It's very similar to (and is based on) gitmoji-cli but written in Rust

 Creating CLI's just got a whole lot better.
Creating CLI's just got a whole lot better.

Staq Creating CLI's just got a whole lot better. Don't worry about CLI colouring, networking, Size of Executables, Speed ever again Have any doubts? R

A set of utilities to better enable polymorphic behavior in Rust

Polymorph A set of utilities to better enable polymorphic behavior in Rust. Introduction Rust is a wonderful language, with a strong emphasis on fast,

Make the github cli even better with fuzzy finding
Make the github cli even better with fuzzy finding

github-repo-clone (grc) Github Repo Clone is a command line utility written in rust that leverages the power of fuzzy finding with the github cli Usag

Better touch. Efficient file creation with templates.

touchx Better touch. Efficient file creation with templates. If you save files such as LICENSE or .editorconfig, you can create files with similar con

Request-bound SQLx transactions for axum

axum-sqlx-rx Request-bound SQLx transactions for axum. Summary axum-sqlx-rx provides an axum extractor for obtaining a request-bound transaction. The

Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps.

rust-yew-axum-tauri-desktop template Rust + Yew + Axum + Tauri, full-stack Rust development for Desktop apps. Crates frontend: Yew frontend app for de

Middlewares and tools to integrate axum + tracing + opentelemetry

axum-tracing-opentelemetry Middlewares and tools to integrate axum + tracing + opentelemetry. Read OpenTelemetry header from incoming request Start a

Comments
Releases(v0.1.0)
Owner
Eray Karatay
Eray Karatay
A fancy diagnostics & error reporting crate

A fancy diagnostics & error reporting crate

Joshua Barretto 1.1k Dec 30, 2022
Error propagation tracing in Rust.

Propagate Error propagation tracing in Rust. Why Propagate? Being able to trace the cause of an error is critical for many types of software written i

Ben Reeves 10 Sep 23, 2021
my attempt at compromise between unwrapping and bullying my dependencies' authors for Error impl

string-eyre Has this happened to you? error[E0599]: the method `wrap_err` exists for enum `Result<(), tauri::Error>`, but its trait bounds were not sa

Michał Sidor 1 Nov 25, 2021
Error context library with support for type-erased sources and backtraces, targeting full support of all features on stable Rust

Error context library with support for type-erased sources and backtraces, targeting full support of all features on stable Rust, and with an eye towards serializing runtime errors using serde.

Findora Foundation 1 Feb 12, 2022
Rust Util Collection, a simple and friendly error-chain

RUC Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition. The painful experience of using error-chain gave b

æ¼¢ 8 Dec 8, 2022
Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition.

RUC Rust Util Collection, a simple and friendly error-chain, with many useful utils as an addition. The painful experience of using error-chain gave b

æ¼¢ 6 Mar 27, 2022
A gitmoji interactive client for using gitmojis on commit messages.

gitmoji in Rust This is just an opinionated version of gitmoji-cli written in Rust . A gitmoji interactive client for using gitmojis on commit message

igor 2 Aug 16, 2022
Log defmt messages over the serial port.

defmt-serial A defmt target for logging over a serial port. Messages can e.g. be read using socat and passed through defmt-print, see example-artemis

Gaute Hope 10 Oct 5, 2022
A CLI tool that automatically writes commit messages for you.

Automagically-generated commit messages A CLI tool that generates commit messages from your staged changes, built in Rust and using OpenAI's Codex. In

Miguel Piedrafita 839 Jan 6, 2023
Generate commit messages using GPT3 based on your changes and commit history.

Commit Generate commit messages using GPT-3 based on your changes and commit history. Install You need Rust and Cargo installed on your machine. See t

Brian Le 40 Jan 3, 2023