グローバルハンドラーについて

グローバルハンドラーの設定についてご相談です。

RPAのアクティビティを組み立てる際、通常はエラーが想定される箇所ごとにTry Catchを組み込むのが一般的だと認識しています。ただし、Try Catchでは個別に設定が必要となるため、ワークフロー全体でエラーが発生した場合に一律で対応する仕組みを検討しています。具体的には、エラーが発生した際に同じ場所を再度クリックし、
それでも次のワークフローに進まない場合はEnterキーを1度送信する、
という対応をすべてのエラーに対して共通で行う想定です。
このような制御を実現する方法として、グローバルハンドラーの使用を想定していますが、実際には意図したとおりに動作しません。
日本語版のUiPathを使用しているものの、グローバルハンドラーの設定画面や記述が英語表記となっており、仕様や正しい使い方の理解に苦慮しています。

同様の設計を行った経験のある方や、グローバルハンドラーを用いた適切なエラー対応の考え方について、ご意見を伺えますと幸いです。

こんにちは

そのセオリーに従った方が良いかと思いますが....
想定外の例外が発生したときの処理がかえって面倒かと思いますし....

Hi @hsgy
Welcome to the Community

Global Exception Handler cannot be used to re-click UI elements or send keyboard keys.

It is designed only for process-level error handling, not UI recovery.

That is why your requirement does not work when implemented in the Global Handler.

You can use Retry scope to handle the scenerio

Hope it help

Thanks & happy automations

ご返信ありがとうございます。
具体的にはRPAで社内システムを起動している際に別のユーザが後からログインしてきた際に読み取り専用にするかどうかのポップアップメッセージが出てきてしまいます。
トライキャッチで解決したいのですがそのポップアップメッセージが出るタイミングをすべての場所で表示させトライキャッチに対応させるのは再現性が難しいためグローバルハンドラーで解決できたらと思っております、、、

上記であればグローバルハンドラーで対応するのではなく、そのポップアップだけに対処するロジックを並列で走らせ処理させるアイデアもあるかと思います。(実際に可能かは、状況次第ですが)

Thank you for your reply.

I understand that handling a “click on the same UI element” uniformly is difficult. That was new to me, so thank you for the clarification.
In that case, would it be possible to design a mechanism where, when an error occurs, the robot first sends the Enter key, and if the error occurs again, it restarts execution from the activity immediately preceding the one where the error occurred?

Best regards,

Sending an Enter key when an error occurs can be done in a Global Exception Handler, and this may help close an unexpected popup if it is still visible. However, this approach is not guaranteed to work in all cases because the popup timing and focus cannot always same and Regarding restarting execution from the activity immediately before the error: this is not supported in UiPath. Once an exception is thrown, the workflow cannot resume from a specific previous activity. UiPath does not provide a built-in mechanism to step back and continue execution from that point.
You can try this approach
1 Use Retry Scope or loop-based retry logic around critical UI actions.
2 Break the workflow into smaller, well-defined sequences so they can be safely retried.
3 Use the Global Exception Handler only for generic recovery actions closing popups, logging, cleanup and then restart the process or the current transaction, not a single activity.

Please let me know if you still have doubts

Thanks

Thank you very much for the detailed explanation.

I had previously understood Try Catch as something applied to individual activities, and the Global Handler as something similar to a Try Catch applied to the entire workflow. However, I now clearly understand that the Global Handler is more suitable for determining recovery actions rather than performing detailed UI recovery itself.

It seems that the behavior I had in mind would be difficult to achieve using a Global Handler, so I will try a different approach.
This was very informative. Thank you very much for your helpful response.

Best regards,

1 Like

ご教示ありがとうございます。グローバルハンドラー以外のやり方も含めて検討してみます。ありがとうございました。

I’m grateful my solution will help you to understand the scenario if it’s helpful please mark as solved so this thread will be closed

Thanks & Happy Automations

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.