# Intercept UIMessageBox messages

**URL:** <https://tech-community.robotics.abb.com/t/intercept-uimessagebox-messages/5387>\
**Category:** Robot Controller\
**Created:** [February 21, 2013, 3:20pm UTC](https://tech-community.robotics.abb.com/t/intercept-uimessagebox-messages/5387 "2013-02-21T15:20:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alyssa\_Wells](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@Alyssa\_Wells](https://tech-community.robotics.abb.com/u/Alyssa_Wells)\
**Post date:** [February 21, 2013, 3:20pm UTC](https://tech-community.robotics.abb.com/t/intercept-uimessagebox-messages/5387/1 "2013-02-21T15:20:14Z")

</div>

I’m trying to test the functionality of safety modules in RAPID. Certain actions cause errors in the program, but are custom UIMessageBox errors, so they can’t be handled with an error handler. Can I intercept these messages for testing purposes? Or, can I read them from the Pendant to ensure they displayed correctly?

Example: If the robot is not in its home position when the start button is pressed, this code executes:

_answer := UIMessageBox (Header:="The Robot is not at the Home Position"MsgArray:=HomePos\_MessageButtons:=btnOKIcon:=iconWarning);_

If possible, I’d like to catch that message instead of displaying it on the Pendant.

---

<div class="post-metadata">

**Author:** ![Henrik\_Berlin](https://dub1.discourse-cdn.com/flex005/user_avatar/tech-community.robotics.abb.com/henrik_berlin/32/1011_2.png) [@Henrik\_Berlin](https://tech-community.robotics.abb.com/u/Henrik_Berlin)\
**Post date:** [February 22, 2013, 9:41am UTC](https://tech-community.robotics.abb.com/t/intercept-uimessagebox-messages/5387/2 "2013-02-22T09:41:03Z")

</div>

Just an idea that popped up:

Make you own custom implementation of UIMessageBox that takes an additional ‘test’ parameter. If it is false, you just call the regular UIMessageBox, but if it is true, then you do something different (whatever that is), e.g

```auto
answer := UIMessageBox2(Header:="The Robot is not at the Home Position"MsgArray:=HomePos_MessageButtons:=btnOKIcon:=iconWarning, **bTest** );
```

The parameter bTest can be a global parameter that you define in some system module.

(Moved to RobotWare).
