Fix error handler for non-project scope