---
name: "MooseX::App::Message::Envelope"
section: "3pm"
platform: "linux"
package: "libmoosex-app-perl"
version: "1.43-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/MooseX::App::Message::Envelope"
---

# MooseX::App::Message::Envelope(3pm)

Message presented to the user

## NAME

MooseX::App::Message::Envelope - Message presented to the user

## DESCRIPTION

Whenever MooseX::App needs to pass a message to the user, it does so by generating a MooseX::App::Message::Envelope object. The object usually contains one or more blocks (MooseX::App::Message::Block) and can be easily stringified.

Usually a MooseX::App::Message::Envelope object is generated and returned by the new\_with\_command method in MooseX::App::Base if there is an error or if the user requests help.

To avoid useless object type checks when working with this method, MooseX::App::Message::Envelope follows the Null-class pattern. So you can do this, no matter if new\_with\_command fails or not:

```
 MyApp->new_with_command->some_method->only_called_if_successful;
```

If

## METHODS

### stringify

Stringifies the messages

### overload

This method is called whenever the object is stringified via overload. In this case it prints the message on either STDERR or STDOUT, and exits the process with the given exitcode (if any).

### add\_block

Adds a new message block. Param must be a MooseX::App::Message::Block

### list\_blocks

Returns a list on message blocks.

### blocks

Message block accessor.

### exitcode

Exitcode accessor.

### has\_exitcode

Check if exitcode is set.

### OVERLOAD

Stringification of this object is overloaded.

### AUTOLOAD

You can call any method on the message class.
