Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How is engine.ExitSuccess(“reason”) handled?

Solved562 views10th May 2024Automation engine InstallPackages
3
Thijs Vanovenacker [SLC] [DevOps Advocate]2.21K 8th May 2024 2 Comments

Hi Dojo,
Can I get some more information on how this method is handled in an automation script?

engine.ExitSuccess(“reason”);

I was using this code inside an Application package install script, expecting that the script would finish successfully after exiting this way.

Instead the installer gave me the failure state with following message:

Looking at the method documentation, it mentions this method is actually throwing an “ScriptAbortException“. And that I should take this into account and probably handle/catch this myself.

How do I properly handle the ScriptAbortException, to differentiate between the success & fail types?

Right now, I added something like this:

I feel the above could probably improve. Any feedback is welcome!

Thank you!

Thijs Vanovenacker [SLC] [DevOps Advocate] Selected answer as best 10th May 2024
Miguel Obregon [SLC] [DevOps Catalyst] commented 8th May 2024

Hi Thijs,
I remember I saw already a similar question:
https://community.dataminer.services/question/interactive-automation-script
The answer states that the exception is expected, but there are no comments about how to make the distinction.

Thijs Vanovenacker [SLC] [DevOps Advocate] commented 8th May 2024

Hi Miguel, Yes I also saw that one as well, after reading Floris’s answer I indeed noticed that the method documentation states there is an “ScriptAbortException” thrown that you should handle. Still it’s not clear how I can determine whether its a success of fail abort-exception…

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
3
Tom Waterbley [SLC] [DevOps Catalyst]8.89K Posted 9th May 2024 2 Comments

Hi Thijs,

I’m afraid there is no other way to distinguish between a fail and success ScriptAbortException. Both ExitSuccess() and ExitFail() only seem to set the message in the exception, so there is no other property you could check.

I actually ran into a similar problem not so long ago. An alternative approach (especially if other code refactors are too challenging) is throwing your own ‘SuccessException’ instead of calling ExitSuccess and use that as some kind of (expensive) goto. You could then catch that exception in the Run method of the script, and handle it accordingly.

Tom Waterbley [SLC] [DevOps Catalyst] Posted new comment 10th May 2024
Thijs Vanovenacker [SLC] [DevOps Advocate] commented 10th May 2024

Hi Tom, thanks for both clarifying and providing a code suggestion. In the end I don’t think I’ll go with throwing a custom exception, I think I’ll just refactor a bit and use a simple condition to execute remaining piece of code, or not. Since the code is not too long and complex, that way I remain keeping it simple. Thanks again

Tom Waterbley [SLC] [DevOps Catalyst] commented 10th May 2024

That’s indeed a better solution than (ab)using exceptions for this.

Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs