Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

making use of "throw" information

EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

When using a function like createPath(), that will throw "Edges do not form a continuous path." if given disjointed inputs, how would I best kill the regeneration and tell the user what's wrong? I feel like there's probably a simple way I'm not aware of. I'm currently trying this, but it doesn't seem to run the catch statement because downstream things just say "Variable path not found".

try
{
var path = constructPath(context, definition.curves);
}
catch (error)
{
regenError("Curves do not form a continuous path", ["curves"], definition.curves);
}

Evan Reese

Answers

  • NeilCookeNeilCooke Moderator, Onshape Employees Posts: 5,714

    End the feature with a return?

    Senior Director, Technical Services, EMEAI
  • EvanReeseEvanReese Member, Mentor Posts: 2,186 ✭✭✭✭✭

    I've not used "return" mid feature like that. good tip. My issue was that I was missing "throw" before the regenError() function.

    Evan Reese
Sign In or Register to comment.