Config...::Error(3pm)

πŸ“¦
version 0.22 Β· 3 versions
, in debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay bestie, say hi to Config:Scoped::Error β€” it's an exception class hierarchy built on top of Error.pm, made specifically for Config::Scoped. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

here's how you actually throw these bad boys πŸ‘‡

use Config::Scoped::Error;

Config::Scoped::Error::Parse->throw(
    -text => $parser_error,
    -file => $config_file,
    -line => $thisline,
);

Config::Scoped::Error::IO->throw(
    -text => "can't open file: $!",
    -file => $config_file,
    -line => $thisline,
);

Config::Scoped::Error::Validate::Macro->throw(
    -text => "macro redefinition: $macro_name",
    -file => $config_file,
    -line => $thisline,
);

like, you pick the class that matches your drama, and you throw with -text, -file and -line. that's it. periodt. πŸ’…


🌸 DESCRIPTION 🌸

Config::Scoped::Error is a class hierarchy based on Error.pm. and the way it's structured? genuinely iconic. here's the full family tree, no cap:

Config::Scoped::Error

    Config::Scoped::Error::Parse

    Config::Scoped::Error::Validate

        Config::Scoped::Error::Validate::Macro

        Config::Scoped::Error::Validate::Parameter

        Config::Scoped::Error::Validate::Declaration

        Config::Scoped::Error::Validate::Permissions

    Config::Scoped::Error::IO

every one of those is a real, defined exception class. main character energy all the way down. πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹

  • Config::Scoped β€” the whole reason this exists
  • Error β€” the parent energy behind it all

iykyk. πŸ’œ


🌈 AUTHOR 🌈

Karl Gaissmaier <karl.gaissmaier at uni-ulm.de>

give them their flowers, fr fr. 🌷


Copyright (c) 2004-2008 by Karl Gaissmaier

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

like β€” free software, do your thing, just keep it under the same terms as Perl itself. no gatekeeping here. 🫢


and that's the whole page, bestie! ✨ this one's from the User Contributed Perl Documentation section, shipped with perl v5.38.2, dated 2024-01-21. go forth and throw your exceptions with confidence πŸ’–πŸ”₯πŸ¦‹

πŸ“¦ where this page comes from