{"record":{"id":"1941ea01ff6889ae","repo":"HelloZeroNet/ZeroNet","slug":"site-blocked-s","errorCode":null,"errorMessage":"Site blocked: %s","messagePattern":"Site blocked: (.+?)","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"plugins/ContentFilter/ContentFilterPlugin.py","lineNumber":41,"sourceCode":"        global filter_storage\n        super(SiteManagerPlugin, self).load(*args, **kwargs)\n        filter_storage = ContentFilterStorage(site_manager=self)\n\n    def add(self, address, *args, **kwargs):\n        should_ignore_block = kwargs.get(\"ignore_block\") or kwargs.get(\"settings\")\n        if should_ignore_block:\n            block_details = None\n        elif filter_storage.isSiteblocked(address):\n            block_details = filter_storage.getSiteblockDetails(address)\n        else:\n            address_hashed = filter_storage.getSiteAddressHashed(address)\n            if filter_storage.isSiteblocked(address_hashed):\n                block_details = filter_storage.getSiteblockDetails(address_hashed)\n            else:\n                block_details = None\n\n        if block_details:\n            raise Exception(\"Site blocked: %s\" % html.escape(block_details.get(\"reason\", \"unknown reason\")))\n        else:\n            return super(SiteManagerPlugin, self).add(address, *args, **kwargs)\n\n\n@PluginManager.registerTo(\"UiWebsocket\")\nclass UiWebsocketPlugin(object):\n    # Mute\n    def cbMuteAdd(self, to, auth_address, cert_user_id, reason):\n        filter_storage.file_content[\"mutes\"][auth_address] = {\n            \"cert_user_id\": cert_user_id, \"reason\": reason, \"source\": self.site.address, \"date_added\": time.time()\n        }\n        filter_storage.save()\n        filter_storage.changeDbs(auth_address, \"remove\")\n        self.response(to, \"ok\")\n\n    @flag.no_multiuser\n    def actionMuteAdd(self, to, auth_address, cert_user_id, reason):\n        if \"ADMIN\" in self.getPermissions(to):","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/plugins/ContentFilter/ContentFilterPlugin.py#L23-L59","documentation":"Guard error raised by the ContentFilter plugin's SiteManagerPlugin.add when the requested site address is present in the user's blocklist (filter_storage.isSiteblocked) and the caller did not bypass the filter with ignore_block or settings kwargs. It enforces the local content-filtering policy rather than reporting a network or data problem.","triggerScenarios":"Thrown at plugins/ContentFilter/ContentFilterPlugin.py:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Catch the exception and show the user a 'site blocked' notice instead of the site content","If the access is intentionally administrative, re-call add() with ignore_block=True in kwargs","Ask the user to remove the address from the blocklist in the site's filter settings before retrying"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"454c0b2e7e000fda7000cba49027541fbf327b96","analyzedAt":"2026-09-02T19:46:57.278Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}