Skip to content

Commit d4ace4b

Browse files
committed
let save fail: raise error w/o wrapping try/catch
1 parent db21c61 commit d4ace4b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

src/components/file/useFile.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,11 @@ function useFile({
146146
}, [writeable, authentication, repository, branch, file, onSaveCache]);
147147

148148
const save = useDeepCompareCallback(async (_content) => {
149-
try {
150-
await saveFile({ authentication, repository, branch, file, content: _content });
151-
// (save() will not happen for "OFFLINE" system files)
152-
await saveCache(); // Empty cache if user has saved this file
153-
await load();
154-
contentActions.reset();
155-
} catch (e) {
156-
console.log(e);
157-
};
149+
await saveFile({ authentication, repository, branch, file, content: _content });
150+
// (save() will not happen for "OFFLINE" system files)
151+
await saveCache(); // Empty cache if user has saved this file
152+
await load();
153+
contentActions.reset();
158154
}, [writeable, authentication, repository, branch, file, load, saveFile, saveCache]);
159155

160156
const dangerouslyDelete = useDeepCompareCallback(async () => {

0 commit comments

Comments
 (0)