Converted error handler to modern syntax.