{"record":{"id":"82b7cf2acee32ce4","repo":"GyulyVGC/sniffnet","slug":"an-error-occurred","errorCode":null,"errorMessage":"An error occurred!","messagePattern":"An error occurred!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/translations/translations.rs","lineNumber":1090,"sourceCode":"//                          Για να προσθέσεις μια σύνδεση στα αγαπημένα σου, κλίκαρε στο σύμβολο με το αστέρι δίπλα στη σύνδεση.\",\n//         Language::FA => \"در حال حاضر هیچ چیزی برای نمایش نیست.\\n\\\n//                         برای افزودن یک پیوند به پسندیده های خود، روی نشان ستاره کنار پیوند کلیک کنید.\",\n//         Language::SE => \"Inget att visa för tillfälet.\\n\\\n//                          För att lägga till anslutningar till dina favoriter, klicka på stjärnsymbolen nära anslutningen.\",\n//         Language::UZ => \"Ayni paytda ko'rsatiladigan hech narsa yo'q.\\n\\\n//         Ulanishni sevimlilar ro'yhatiga qo'shish uchun ulanish yaqinidagi yulduzcha belgisini bosing.\"\n//         Language::ID => \"Tidak ada yang ditampilkan untuk saatini.\\n\\\n//                          untuk menambah koneksi ke favorit, klik dilogo bintang dekat dengan koneksi.\",\n//         Language::NL => \"Niets om te laten zien op dit moment.\\n\\\n//                          Om een verbinding toe te voegen aan je favorieten, klik op het ster symbool naast de verbinding.\",\n//         Language::HU => \"Jelenleg nincs mutatni való.\\n\\\n//                          A kedvencekhez való hozzáadáshoz nyomj rá a csillag jelre egy adott kapcsolat mellett.\",\n//     })\n// }\n\npub fn error_translation(language: Language) -> &'static str {\n    match language {\n        Language::EN => \"An error occurred!\",\n        Language::CS => \"Vyskytla se chyba!\",\n        Language::IT => \"Si è verificato un errore!\",\n        Language::FR => \"Une erreur est survenue!\",\n        Language::ES => \"¡Se ha producido un error!\",\n        Language::PL => \"Wystąpił błąd!\",\n        Language::DE => \"Es ist ein Fehler aufgetreten!\",\n        Language::UK => \"Зʼявилась помилка!\",\n        Language::ZH => \"发生了一些错误!\",\n        Language::ZH_TW => \"發生錯誤！\",\n        Language::RO => \"A apărut o eroare!\",\n        Language::KO => \"오류가 발생하였습니다!\",\n        Language::TR => \"Bir hata oluştu!\",\n        Language::RU => \"Произошла ошибка!\",\n        Language::PT => \"Ocorreu um erro!\",\n        Language::EL => \"Κάποιο σφάλμα συνέβη!\",\n        // Language::FA => format!(\n        //     \"خطایی رخ داد! \\n\\n\\\n        //                         {error}\"","sourceCodeStart":1072,"sourceCodeEnd":1108,"githubUrl":"https://github.com/GyulyVGC/sniffnet/blob/48b0575dc0d3c7e503a466a3cb2c1466ba600f8e/src/translations/translations.rs#L1072-L1108","documentation":"error_translation() (src/translations/translations.rs:1090) returns the localized generic banner 'An error occurred!' used by the GUI's waiting page (src/gui/pages/waiting_page.rs:38) whenever sniffer.pcap_error is set. The banner is not an error itself: it is prefixed above the concrete pcap error string, which was captured earlier as CaptureContext::Error(e.to_string()). It tells the user packet capture could not start or continue.","triggerScenarios":"The waiting page renders this text when CaptureContext construction failed: device open failure (permissions, missing adapter — error 7), BPF filter rejection (error 8), or output pcap savefile creation failure (error 9). It shows when capture hasn't started (tot_packets == 0 and pcap_error present) and stays until the user changes capture settings and restarts.","commonSituations":"Launching Sniffnet without capture privileges (most common); selecting a network adapter that was unplugged or renamed after app start; typing an invalid BPF filter in the filter panel; choosing a pcap output path in a read-only directory; opening a corrupted or non-pcap file as the capture source.","solutions":["Read the second paragraph under the banner — it is the raw error string (e.g. 'libpcap error: permissions problem') and identifies which of the three failure classes it is.","If it is a permissions error, restart with elevated privileges or grant the binary CAP_NET_RAW (Linux), run as admin/Npcap user (Windows).","If the error mentions the filter, re-enter or clear the BPF filter text and restart the run.","If the error mentions the output file, pick a writable .pcap path or disable pcap output.","If the adapter disappeared, reopen adapter selection and pick a currently active device."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always read the concrete error text under the banner — it selects the fix (permissions vs filter vs output file).","Start Sniffnet with capture privileges from the beginning so the banner never appears.","Validate the BPF filter with `tcpdump -d '<expr>'` before entering it in the GUI.","When choosing a pcap output path, test that the directory is writable first."],"tags":["rust","sniffnet","gui","i18n","pcap","user-facing"],"backgroundTag":null,"analyzedSha":"48b0575dc0d3c7e503a466a3cb2c1466ba600f8e","analyzedAt":"2026-08-16T09:14:10.427Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}