file [Solved] Function exception

9 years 2 weeks ago #136 by jmmalmedy
Hello,

Could you tell me how I can add some exceptions to class functions, please? When I do a reverse engineering of Java classes, the exceptions are present. But I don't know how I can add more exceptions. I haven't found it in the user guide.

Thanks in advance,

J-M Malmedy

Please Log in or Create an account to join the conversation.

9 years 2 weeks ago #137 by barbe.rousse
Hi,

A quick solution would be to clone your RaisedException element and change the 'Thrown type' of the new one.

Regards,

BR.

Please Log in or Create an account to join the conversation.

9 years 2 weeks ago #139 by jmmalmedy
Thanks...

Do you mean there are no "regular" ways to add an exception to a function?

Regards

Please Log in or Create an account to join the conversation.

9 years 2 weeks ago #140 by barbe.rousse
Hi,

If you want to add an exception to a function you have to create a RaisedException link between your method and the exception class. That is the regular way.
But you have many ways to do this.
One is to clone an existing RaisedException and change its 'Thrown type'.
I prefer create the RaisedException link in a class diagram but it is a personal choice.

Regards,

BR.
The following user(s) said Thank You: andy

Please Log in or Create an account to join the conversation.

9 years 2 weeks ago #141 by jmmalmedy
Yes, it works...

I was searching for a way to do this in the model explorer. I hadn't thought about doing this in a diagram.

Thanks a lot.

Please Log in or Create an account to join the conversation.

Moderators: tma
Time to create page: 0.041 seconds
^ Back to Top