Skip to content
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

FileWatcher should throw NoSuchFileException? #532

Closed
minwoox opened this issue Sep 7, 2020 · 3 comments
Closed

FileWatcher should throw NoSuchFileException? #532

minwoox opened this issue Sep 7, 2020 · 3 comments

Comments

@minwoox
Copy link
Contributor

minwoox commented Sep 7, 2020

Currently, FileWatcher.awaitInitialValue(...); throws TimeoutException rather than NoSuchFileException if the file, which the watcher tries to watch, does not exist.
It makes the user hard to find the cause.

@trustin
Copy link
Member

trustin commented Sep 7, 2020

I think there should be an option for this behavior, because some users might want to wait until the file is created. I agree that the default behavior should be to throw an exception.

minwoox added a commit to minwoox/centraldogma that referenced this issue Jun 11, 2021
Motivation:
Related line#532
Currently, when we try to watch a file which doesn't exist,
the watch API waits until the file is added or timeout happens.
It sometimes makes user difficult to debug because the client cannot distinguish such cases.

Modifications:
- Add `notify-entry-not-found` preference to the watch `Prefer` header.
  - https://datatracker.ietf.org/doc/html/rfc7240#section-4

Result:
- You can now get notified if the entry doesn't exist when watching.

To-do:
- Add the option to client-side
minwoox added a commit to minwoox/centraldogma that referenced this issue Jun 11, 2021
Motivation:
Related line#532
Currently, when we try to watch a file which doesn't exist,
the watch API waits until the file is added or timeout happens.
It sometimes makes user difficult to debug because the client cannot distinguish such cases.

Modifications:
- Add `notify-entry-not-found` preference to the watch `Prefer` header.
  - https://datatracker.ietf.org/doc/html/rfc7240#section-4

Result:
- You can now get notified if the entry doesn't exist when watching.

To-do:
- Add the option to client-side
@di-seo
Copy link
Contributor

di-seo commented Nov 22, 2021

I try to handle this issue.

minwoox added a commit that referenced this issue Nov 25, 2021
…610)

Motivation:
Related #532
Currently, when we try to watch a file that doesn't exist,
the watch API waits until the file is added or timeout happens.
It sometimes makes user difficult to debug because the client cannot distinguish such cases.

Modifications:
- Add `notify-entry-not-found` preference to the watch `Prefer` header.
  - https://datatracker.ietf.org/doc/html/rfc7240#section-4

Result:
- You can now get notified if the entry doesn't exist when watching.

To-do:
- Add the option to client-side
minwoox pushed a commit that referenced this issue Dec 9, 2021
### Motivation
- #532
- To-Do of #610

### Modifications
- Put value of `notify-entry-not-found` on `Prefer` request header to get error that entries are not found on watching file/repository
- Propagate error that entries are not found into `Watcher#initialValueFuture`

### Result
- You can get error on watching file/repository if the entry doesn't exist.
@minwoox
Copy link
Contributor Author

minwoox commented Feb 24, 2022

Closed via #653

@minwoox minwoox closed this as completed Feb 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants