[Debug] merge LegacyErrorHandler into ErrorHandler