Skip to content

Set what string in Error::SetMessage

Kenneth Moreland requested to merge kmorel/vtk-m:what-in-error into master

vtkm::cont::Error inherits from std::exception. As such, it has a special what string that reports an error message in a standard way. This is particularly useful when a vtkm::cont::Error exception remains uncaught because the system will print the what string before crashing.

Unfortunately, the what string was only being set in the Error constructor that took a message. That is a problem for subclasses like ErrorCuda that used the default constructor and then used SetMessage. The what string did not get set in this case.

Change the behavior to capture the stack trace in the default constructor and update the what string if a subclass uses SetMessage.

Merge request reports