Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make runtime exceptions explainable #1456

TimLethbridge opened this issue May 16, 2019 · 0 comments


None yet
2 participants
Copy link

commented May 16, 2019

Currently there are several places when Umple at runtime raises an exception due to various situations occurring.

For example the following code is found in

class A {}
class B {
  1 -- * A endTwo; 

An A can only have one associated B, so in the constructor of A there is code that may fail the construction due to the presence of the B. The generated code thus throws an exception as follows:

throw new RuntimeException("Unable to create endTwo due to b");

The trouble is, when code is executing, and this message appears in a stack trace, the end-user will not have a clue what is going on. Even the beginner Umple developer may not understand, since they are not generally supposed to be looking at the generated code.

What is needed is:

  1. Create a new 'Runtime Exceptions' section of the user manual (after 'Errors and Warnings 1000+ by modifying

  2. For each runtime exception:
    a) assign a user manual page explaining the problem, including a various cases where this can occur, and a good explanation of what is going on and how to resolve it.
    b) on each of the places in the code where exceptions are thrown. Add '. See URL' after the textual descripton, where the URL is the pointer to the user manual. This will require changing various tests that were not expecting to encounter the URL.

To find the places where runtime exceptions are thrown in Java go to umple/UmpleToJava/UmpleTLTemplates and do

grep RuntimeException * 

The result lists 8 places, including

constructor_AssociationAssignOne.ump:6 constructor_AssociationAssignOneToOne.ump:5

TimLethbridge added a commit that referenced this issue Jun 10, 2019

Merge pull request #1458 from umple/issue1456
Fixes #1456 Runtime Exceptions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.