#derive #enums #macro #required #msg #err #majordome

macro majordome-derive

Derive macros for the majordome crate

11 stable releases

1.0.10 Aug 3, 2024
1.0.9 Jul 22, 2024
1.0.8 Jul 21, 2024
1.0.4 Jul 18, 2024
1.0.2 May 5, 2024

#27 in #err

Download history 1/week @ 2024-06-28 10/week @ 2024-07-05 73/week @ 2024-07-12 674/week @ 2024-07-19 214/week @ 2024-07-26 159/week @ 2024-08-02 13/week @ 2024-08-09 9/week @ 2024-08-16 4/week @ 2024-08-23 6/week @ 2024-08-30 75/week @ 2024-09-13 30/week @ 2024-09-20 16/week @ 2024-09-27 2/week @ 2024-10-04 3/week @ 2024-10-11

53 downloads per month
Used in 3 crates (2 directly)

MIT license

32KB
648 lines

Majordome Errors Enums

#[derive(MajordomeError)]
#[err(prefix = "errors.gg.wls.")]
pub enum AuthError {
    #[err(code="invalid_token", msg="Invalid token", status=401)]
    InvalidToken,

    #[err(code="unknown_event", msg="Unknown event {id}", status=404)]
    UnknownEvent {id: String},

    #[err(code="not_enough_players", msg="Not enough players (required: {required}, actual: {actual})", status=400)]
    NotEnoughPlayers{required: u32, actual: u32},
}

Dependencies

~1.5MB
~37K SLoC