{"record":{"id":"4a3ad2faac6e0ec2","repo":"OtterMind/Chat2DB","slug":"e-getmessage","errorCode":null,"errorMessage":"e.getMessage()","messagePattern":"e\\.getMessage\\(\\)","errorType":"exception","errorClass":"BusinessException","httpStatus":null,"severity":"error","filePath":"chat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/frame/MainJFrame.java","lineNumber":377,"sourceCode":"    private void setupGenericPlatformSpecifics(Image appIcon) {\n        this.setTitle(appName);\n        this.setIconImage(appIcon);\n        applyTheme(ThemeEnum.DARK);\n    }\n    private static Image buildAppLogoImage() {\n        ResourceLoader resourceLoader = new DefaultResourceLoader();\n        Resource resource;\n        if (ConfigUtils.isOffline()) {\n            resource = resourceLoader.getResource(\"classpath:logo_local.png\");\n        }else {\n            resource = resourceLoader.getResource(\"classpath:logo_pro.png\");\n        }\n        URL imageUrl;\n        try {\n            imageUrl = resource.getURL();\n        } catch (IOException e) {\n            log.error(e.getMessage(), e);\n            throw new BusinessException(e.getMessage());\n        }\n        log.info(\"Image URL: {}\", imageUrl);\n        return new ImageIcon(imageUrl).getImage();\n    }\n    public void applyTheme(ThemeEnum theme) {\n        log.info(\"Applying {} theme to menu UI.\", theme);\n        applyCommonMenuFont();\n        if (theme == ThemeEnum.DARK) {\n            initDarkModeMenuUI();\n        } else {\n            initLightModeMenuUI();\n        }\n        SwingUtilities.updateComponentTreeUI(this);\n    }\n    private void applyCommonMenuFont() {\n        Font defaultFont = UIManager.getFont(\"Menu.font\");\n        if (defaultFont == null) {\n            defaultFont = new Font(\"SansSerif\", Font.PLAIN, 12);","sourceCodeStart":359,"sourceCodeEnd":395,"githubUrl":"https://github.com/OtterMind/Chat2DB/blob/5ee1e990e73fbcae1969dc554be254fedb3ab888/chat2db-community-server/chat2db-community-jcef/src/main/java/ai/chat2db/community/jcef/frame/MainJFrame.java#L359-L395","documentation":"BusinessException carrying the raw IOException message from MainJFrame when resolving the window logo image URL fails. The code picks logo_local.png (offline) or logo_pro.png (online) from the classpath via DefaultResourceLoader and, on IOException, rethrows e.getMessage() directly as the business message.","triggerScenarios":"resource.getURL() throws IOException because the packaged logo resource (logo_local.png / logo_pro.png) is absent from the classpath, the JAR/resource directory is unreadable, or the resource loader cannot resolve it.","commonSituations":"Desktop/JCEF build assembled without copying the logo asset into the jar; classpath resource renamed/removed; offline flag (chat2db.network.status=OFFLINE) selecting logo_local.png when only logo_pro.png is packaged; corrupted jar.","solutions":["Confirm the matching logo asset exists on the classpath: logo_local.png when offline, logo_pro.png otherwise.","Rebuild the start module so frontend/static assets (including the logo pngs) are assembled into the jar/resources.","Align chat2db.network.status with the logo variant actually packaged.","Note the message is e.getMessage() verbatim — it is not localized, so treat it as a packaging/classpath defect, not a user-facing message."],"exampleFix":"// before\nimageUrl = resource.getURL();\n// after: defensive fallback to whichever logo is present\nResource r = ConfigUtils.isOffline()\n    ? resourceLoader.getResource(\"classpath:logo_local.png\")\n    : resourceLoader.getResource(\"classpath:logo_pro.png\");\nif (!r.exists()) r = resourceLoader.getResource(\"classpath:logo.png\");\nimageUrl = r.getURL();\n","handlingStrategy":"validation","validationCode":"Resource r = ConfigUtils.isOffline()\n    ? resourceLoader.getResource(\"classpath:logo_local.png\")\n    : resourceLoader.getResource(\"classpath:logo_pro.png\");\nif (!r.exists()) throw new BusinessException(\"logo resource missing on classpath\");","typeGuard":null,"tryCatchPattern":"try { imageUrl = resource.getURL(); }\ncatch (java.io.IOException e) {\n    log.error(\"logo resource unresolved\", e);\n    throw new BusinessException(\"logo resource unavailable\", e);\n}","preventionTips":["Confirm the matching logo asset is packaged for the selected offline/online mode.","Rebuild the start module so static assets are assembled into the jar.","Align chat2db.network.status with the logo variant that ships.","Provide a fallback logo resource to avoid a hard startup failure."],"tags":["desktop","jcef","resource","packaging","classpath"],"backgroundTag":null,"analyzedSha":"5ee1e990e73fbcae1969dc554be254fedb3ab888","analyzedAt":"2026-08-14T07:05:03.077Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}