class ErrorProcessor {

    /**
     * Logger.
     */
    private static final Logger LOGGER = LogManager.getLogger(ErrorProcessor.class);

    /**
     * Language service.
     */
    @Inject
    private LangPropsService langPropsService;

    /**
     * Data model service.
     */
    @Inject
    private DataModelService dataModelService;

    /**
     * Role query service.
     */
    @Inject
    private RoleQueryService roleQueryService;

    /**
     * Handles the error.
     *
     * @param context the specified context
     */
    public void handle(final RequestContext context) {<FILL_FUNCTION_BODY>}
}

        final String statusCode = context.pathVar("statusCode");
        if (StringUtils.equals("GET", context.method())) {
            final String requestURI = context.requestURI();
            final String templateName = statusCode + ".ftl";
            LOGGER.log(Level.TRACE, "Shows error page[requestURI={}, templateName={}]", requestURI, templateName);

            final AbstractFreeMarkerRenderer renderer = new SkinRenderer(context, "error/" + templateName);
            final Map<String, Object> dataModel = renderer.getDataModel();
            dataModel.putAll(langPropsService.getAll(Locales.getLocale()));
            dataModelService.fillHeaderAndFooter(context, dataModel);
            dataModelService.fillSideHotArticles(dataModel);
            dataModelService.fillRandomArticles(dataModel);
            dataModelService.fillSideTags(dataModel);

            final JSONObject user = Sessions.getUser();
            final String roleId = null != user ? user.optString(User.USER_ROLE) : Role.ROLE_ID_C_VISITOR;
            final Map<String, JSONObject> permissionsGrant = roleQueryService.getPermissionsGrantMap(roleId);
            dataModel.put(Permission.PERMISSIONS, permissionsGrant);

            dataModel.put(Common.ELAPSED, 0);

            final Map<String, Object> contextDataModel = (Map<String, Object>) context.attr("dataModel");
            if (null != contextDataModel) {
                dataModel.putAll(contextDataModel);
            }
        } else {
            context.renderJSON(StatusCodes.ERR).renderMsg(statusCode);
        }
    
<no_super_class>