-
Notifications
You must be signed in to change notification settings - Fork 39
Refactor watcher 3 #1317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor watcher 3 #1317
Changes from all commits
2d5024c
a253b3b
861ff45
0ccc245
cf15e72
1410fc2
1492967
fc86224
f2873e2
6925b1c
a523dc4
36b1272
84412f8
88e7070
3b72e43
50727c7
8825895
62b713d
99d4584
f95899a
8e6b8d1
196e254
346f12b
e5d6538
86765a6
500fbdb
0c7ef1d
f7fac91
baba74d
3260175
7314cd6
438781f
2f3a996
4a04124
b593914
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,24 +10,17 @@ type TProps = { | |
| }; | ||
|
|
||
| export async function onAddDir({ ctx, path }: TProps) { | ||
| try { | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just remove try catch here, we are already cathing in the previous one and logging the whole event. |
||
| const { data: folderInfo } = await NodeWin.getFolderInfo({ ctx, path }); | ||
| const { data: folderInfo } = await NodeWin.getFolderInfo({ ctx, path }); | ||
|
|
||
| if (folderInfo) { | ||
| await moveFolder({ ctx, path, uuid: folderInfo.uuid }); | ||
| return; | ||
| } | ||
| if (folderInfo) { | ||
| await moveFolder({ ctx, path, uuid: folderInfo.uuid }); | ||
| return; | ||
| } | ||
|
|
||
| const { data: parentInfo } = await NodeWin.getFolderInfo({ ctx, path: dirname(path) }); | ||
| const { data: parentInfo } = await NodeWin.getFolderInfo({ ctx, path: dirname(path) }); | ||
|
|
||
| if (parentInfo) { | ||
| await Drive.Actions.createFolder({ | ||
| ctx, | ||
| path, | ||
| parentUuid: parentInfo.uuid, | ||
| }); | ||
| } | ||
| } catch (error) { | ||
| ctx.logger.error({ msg: 'Error on addDir event', path, error }); | ||
| if (parentInfo) { | ||
| const parentUuid = parentInfo.uuid; | ||
| await Drive.Actions.createFolder({ ctx, path, parentUuid }); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just remove try catch here, we are already cathing in the previous one and logging the whole event.