When to use the Throw or Rethrow activities in UiPath

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ก.ย. 2024
  • This video clarifies the usage of the Throw and Rethrow activities in UiPath, highlights the differences between them, and provides a simple use-case demo for using either of the two activities.
    While these activities are probably not used everyday, it comes in handy to know how to use them in your exception handling logic, and they are crucial if you want to design your exception handling in a good, multi-level structure.
    00:01 Topic and summary of the video
    00:18 UiPath Hacks intro theme
    00:42 Exception handling overview
    01:25 System Demo of using Throw vs. Rethrow. There are two cascaded Try-Catch blocks.
    03:18 The Throw Activity throws a new exception, eg. a business one. A new catch block should be defined for this new exception type.
    04:50 The Rethrow Activity throws the SAME exception (don't even have a chance to define a new exception in the properties panel)
    06:14 Wrap-up and conclusion
    Let us keep in touch:
    / gabrielverzea

ความคิดเห็น • 15

  • @kenchang3456
    @kenchang3456 3 ปีที่แล้ว +2

    Thanks for another excellent video. Do you have a video or could I request a video to show how to reschedule a job on orchestrator in case of a business or system exception? For example, I have a job that starts at a set time which updates a Excel workbook. If the workbook is open by someone else and I try to do a read range on it I would like to email the person(s) that have the workbook open asking them to exit the workbook and then reschedule the job to start 30 mins later and then abandon trying to run the job after say 3 tries. It doesn't seem like Orchestrator has that as a built-in capability.

    • @UiPathHacks
      @UiPathHacks  3 ปีที่แล้ว +1

      Hi Ken. This is a great idea. I did not try this out so far, but I will have a look and let you know if I find an easy solution. I would imagine it could be solved with some API calls, but I have to try some things out.
      Another idea would be to add a queue item when you catch the exception, and increment there the number of fails. And create a Queue trigger that will start as soon as there is an item on that queue. But I am not sure how to introduce the 30min delay in an elegant way, other than send this number with the queue item and include a delay activity for whatever value defined on the queue. This is not ideal, as the bot would then be in use for all this time and not allow another process to run in parallel.
      I will think about it some more.

    • @kenchang3456
      @kenchang3456 3 ปีที่แล้ว

      @@UiPathHacks thanks for considering the thought. I thought about updating an asset and having the bot scheduled every 30 mins and if current time was greater than asset time let the bot run. Again, not very elegant.

  • @UiPathHacks
    @UiPathHacks  3 ปีที่แล้ว

    The link to the XAML file I uploaded in the UiPath Forum:
    forum.uipath.com/t/how-to-use-throw-and-rethrow/11772/38

  • @emiliadaian648
    @emiliadaian648 2 ปีที่แล้ว

    Hello Gabi. Thank you for explanation. It is very useful in understanding how throw and rethrow works. As a quick suggestion would be nice if you can upload the xaml (maybe on uipath forum) so we can replicate your example.

    • @UiPathHacks
      @UiPathHacks  2 ปีที่แล้ว

      Hi Emilia. great suggestion. I posted the XAML file in the UiPath Forum and linked it in the comments of this video, as well:
      forum.uipath.com/t/how-to-use-throw-and-rethrow/11772/38

  • @gidionmanojkumar8279
    @gidionmanojkumar8279 3 ปีที่แล้ว +1

    Enlightened 💥

    • @UiPathHacks
      @UiPathHacks  3 ปีที่แล้ว +1

      Glad to be of service :)

  • @kenchang3456
    @kenchang3456 3 ปีที่แล้ว

    Excellent work. Thank you for sharing.

  • @Ramimanimation
    @Ramimanimation 3 ปีที่แล้ว

    You are very good in this thing

  • @jonekopir5558
    @jonekopir5558 3 ปีที่แล้ว

    Excellent

    • @UiPathHacks
      @UiPathHacks  3 ปีที่แล้ว

      Thank you so much 😀

  • @thebig01-np2jd
    @thebig01-np2jd 5 หลายเดือนก่อน

    A video for this please? - this things you can find in internet. Didn't find anything useful in this video :)