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

[1.0] Use exceptions if error(s) happen(s) #497

Open
10 of 12 tasks
akerouanton opened this issue Jun 2, 2017 · 1 comment
Open
10 of 12 tasks

[1.0] Use exceptions if error(s) happen(s) #497

akerouanton opened this issue Jun 2, 2017 · 1 comment
Assignees
Milestone

Comments

@akerouanton
Copy link
Contributor

akerouanton commented Jun 2, 2017

Currently we return false (or something similar) to notify error(s). It leads to bad DX. However, in some cases native exceptions are used but they're too general. Specific exceptions would be better, we should improve this for v1.0.

Proposal

  • Introduce a generic exception for Adapter (named StorageFailure)
  • Introduce a generic exception for Filesystem (named FilesystemFailure)

The reason for two distinct exceptions goes as is: Filesystem has a compatibility layer that mimics some behaviors based on the minimal subset of functionality offered by Adapter interface.

Also, it would be great to introduce more specific exceptions like FileNotFound.

Todo

@akerouanton akerouanton added this to the v1.0 milestone Jun 2, 2017
@akerouanton akerouanton changed the title Use exceptions if error(s) happen(s) [1.0] Use exceptions if error(s) happen(s) Aug 8, 2017
@akerouanton
Copy link
Contributor Author

akerouanton commented Aug 8, 2017

We need to remove support of php v5.6 if we want to properly handle errors for Local adapter. Also OpenCloud adapter shouldn't be fixed for now: it's based on an outdated SDK.

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