fix error handler type
fix const generation