Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] e.getCause() missing in ConditionalProcessGroup and TemplateProcessHandler

While working on the new Embed CDT templates, I encountered a bug in ConditionalProcessGroup, causing the loss of the initial exception cause.


The code reads:

```
} catch (ProcessFailureException e) {
throw new ProcessFailureException(e.getMessage(), e, statuses);
}
```

Instead, it should read:

```
} catch (ProcessFailureException e) {
throw new ProcessFailureException(e.getMessage(), e.getCause(), statuses);
}
```

The result is that the window displaying the message no longer shows the exception cause, but doubles the message, looking like:

```
xyz
Reason:
xyz
```

There are two such cases (search for '(e.getMessage(), e,' in core/org.eclipse.cdt.core/templateengine), and both need similar fixes.

My (poor) workaround was to no longer pass my own error message, but the original exception cause, which is also shown twice, but at least I have an error indication:




If I remember right, the problem is very old, which also means it has a low priority, but it would be nice to fix it in the next release.

Please let me know when the migration to GitHub (which is a great step!) is complete so I can register this new issue and possibly contribute a patch.


Regards,

Liviu

Back to the top