Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 API for Ruby Documentation | 2025.2

# Class P4::Message

## Description

`P4::Message` objects contain error or other diagnostic messages from the P4 Server; retrieve them by using the `P4#messages()` method.

Script writers can test the severity of the messages in order to determine if the server message consisted of command output (`E_INFO`), warnings, (`E_WARN`), or errors (`E_FAILED`/`E_FATAL`).

## Class methods

None.

## Instance methods

### message.severity() -> anInteger

Severity of the message, which is one of the following values:

Value | Meaning
--- | ---
`E_EMPTY` | No error
`E_INFO` | Informational message only
`E_WARN` | Warning message only
`E_FAILED` | Command failed
`E_FATAL` | Severe error; cannot continue.

### message.generic() -> anInteger

Returns the generic class of the error.

### message.msgid() -> anInteger

Returns the unique ID of the message.

### message.to_s() -> aString

Converts the message into a string.

### message.inspect() -> aString

To facilitate debugging, returns a string that holds a formatted representation of the entire `P4::Message` object.

Your search for returned results