@setoelkahfi / svara / commits / 50e54aa

chore: added console error for file reading failure

mellbacon committed Jun 24, 2023 at 19:35 UTC 50e54aa116ab1f8e880c1b071ffb6b090f648270
1 file changed +2
src/lib/Tab/Tab.ts
+2
@@ -71,6 +71,7 @@ export class Tab {
71 try {
72 fileContent = await fs.readTextFile(path); //TODO: Fix performance issues/loading times on large files
73 } catch (error) {
74 + console.error(error);
75 console.warn("Can't read file content. Setting to empty string.");
76 }
77 let content = new Editor({target: document.getElementById("tabview"), props: {content: fileContent}});
@@ -78,6 +79,7 @@ export class Tab {
79 tab.isfile = true;
80 tab.saved = true;
81 let fileType = "";
82 +
83 try {
84 fileType = await p.extname(tab.path);
85 } catch (error) {