1MooseX::App::Message::EUnsveerloCpoen(t3r)ibuted Perl DoMcouomseenXt:a:tAipopn::Message::Envelope(3)
2
3
4
6 MooseX::App::Message::Envelope - Message presented to the user
7
9 Whenever MooseX::App needs to pass a message to the user, it does so by
10 generating a MooseX::App::Message::Envelope object. The object usually
11 contains one or more blocks (MooseX::App::Message::Block) and can be
12 easily stringified.
13
14 Usually a MooseX::App::Message::Envelope object is generated and
15 returned by the new_with_command method in MooseX::App::Base if there
16 is an error or if the user requests help.
17
18 To avoid useless object type checks when working with this method,
19 MooseX::App::Message::Envelope follows the Null-class pattern. So you
20 can do this, no matter if new_with_command fails or not:
21
22 MyApp->new_with_command->some_method->only_called_if_successful;
23
24 If
25
27 stringify
28 Stringifies the messages
29
30 overload
31 This method is called whenever the object is stringified via overload.
32 In this case it prints the message on either STDERR or STDOUT, and
33 exits the process with the given exitcode (if any).
34
35 add_block
36 Adds a new message block. Param must be a MooseX::App::Message::Block
37
38 list_blocks
39 Returns a list on message blocks.
40
41 blocks
42 Message block accessor.
43
44 exitcode
45 Exitcode accessor.
46
47 has_exitcode
48 Check if exitcode is set.
49
50 OVERLOAD
51 Stringification of this object is overloaded.
52
53 AUTOLOAD
54 You can call any method on the message class.
55
56
57
58perl v5.32.0 2020-07-28 MooseX::App::Message::Envelope(3)