Skip to content

Infinite recursion in basic exception handler #1141

@jolting

Description

@jolting

ret = e.what();

This should be

const auto* ecb = dynamic_cast<const ExceptionWithCallBackBase*>(&e);
if(ecb)
{
  ret = ecb->originalWhat;
}
else
{
  ret = e->what();
}

Since m_what is empty.

call exception_to_str

std::string mrpt::exception_to_str(const std::exception& e)

call impl_excep_to_str
void impl_excep_to_str(

call basic version
ret = e.what();

call e.what(), m_what is still empty
if (m_what.empty()) m_what = mrpt::exception_to_str(*this);

repeat steps 1-4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions