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

C/C++ API Documentation | 2025.2

# ClientUser::ErrorPause( char *, Error * )

Outputs an error and prompts for a keystroke to continue.

Virtual? | Yes |
Class | `ClientUser` |
Arguments | `char *errBuf` | the error message to be printed
| `Error *e` | an `Error` object
Returns | `void` |

## Notes

The default implementation of `ErrorPause()` consists solely of calls to `OutputError()` and `Prompt()`.

## Example

One situation that results in a call to `ErrorPause()` is an incorrectly edited specification; for example:

Copy

    &gt; p4 client
    ...
    Error in client specification.
    Error detected at line 31.
    Wrong number of words for field 'Root'.
    Hit return to continue...

In this instance, the first three lines of output were the `errBuf` argument to `ErrorPause()`; they were displayed using `OutputError()`.

To display an error and prompt for confirmation within a GUI application, create a subclass of `ClientUser` that overrides `ErrorPause()` and use this subclass in place of `ClientUser`.

Suppose that you have a function `MyWarning()` that takes a `char *` as an argument, and displays the argument text in an appropriate popup dialog that has to be clicked to be dismissed. You can implement `ErrorPause()` as a call to this function, as follows:

Copy

    void MyClientUser::ErrorPause( char *errBuf, Error *e )
    {
        MyWarning( errBuf );
    }

Within a GUI, the warning text and "OK" button are probably bundled into a single dialog, so overriding `ErrorPause()` is a better approach than overriding `OutputError()` and `Prompt()` separately.

Your search for returned results