This is a migrated thread and some comments may be shown as answers.

How to fail a CodedStep

1 Answer 51 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Michel
Top achievements
Rank 1
Michel asked on 16 Feb 2011, 04:15 PM
Hi,

I have a CodedStep function and I would like to some conditions, the coded step return fail.

I see that I can use ASSERT but how I do that if I have many operations to do before the function return.

sample:
if ( my condition here)
{
        line code 1
        line code 2
        line code 3
        RETURN FAIL HERE.....
}

thanks

1 Answer, 1 is accepted

Sort by
0
Stoich
Telerik team
answered on 16 Feb 2011, 04:44 PM
Hello Michel,
   throwing any exception will fail your coded step. In your example it will look like this:

sample:
if ( my condition here)
{
        line code 1
        line code 2
        line code 3
         
throw new Exception();
}
This will work with any class that extends Exception.

Let me know if you have any other questions!

Regards,
Stoich
the Telerik team
Tags
General Discussions
Asked by
Michel
Top achievements
Rank 1
Answers by
Stoich
Telerik team
Share this question
or