Returning error from a python-scripted Scenario

Solved!
Keufran
Level 3
Returning error from a python-scripted Scenario

Hello Dataiku-world,

I'm looking for a way to return a status (OK, ERROR) from a custom scripted scenario (Python, DSS 7.02)

I naivly tried the following:

scenario = Scenario()

scenario.outcome= "OK" (or "ERROR")

But this don't work. Even throwing an exception from my code is intercepted and the scenario appears to be executed correctly.

0 Kudos
1 Solution
MarcH
Dataiker

Hello,

Are you just trying to get the scenario to fail?

How are you throwing the exception in your code? I was able to get a Python scenario to fail by simply raising an exception:

raise Exception('failed run')

 

View solution in original post

0 Kudos
2 Replies
MarcH
Dataiker

Hello,

Are you just trying to get the scenario to fail?

How are you throwing the exception in your code? I was able to get a Python scenario to fail by simply raising an exception:

raise Exception('failed run')

 

0 Kudos
Keufran
Level 3
Author

It seems I missed something when throwing the exception... Your solution works perfectly.

0 Kudos