Skip to content
Advertisement

Exception handling execution flow

I have the following code.

When customer does not exist it executes Throw Number 1.

Execution continues and gets to Throw Number 2.

So the displayed message ends up being the one from Throw Number 2.

But I don’t want that to happen.

When execution gets to Throw Number 1, it should stop there and never get to Throw Number 2 so that the message from Throw Number 1 is the one displayed.

How to do that?

JavaScript

Advertisement

Answer

You can do something like:

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement