Right now CubeMX generates code with the following signature of Error_Handler function:
void _Error_Handler(char *, int);
When I turn my project to use c++, compiler doesn't like it, and I change it to the following:
void _Error_Handler(const char *, int);
So I suggest to adjust code generation accordingly.