Skip to content
This repository has been archived by the owner on Feb 12, 2019. It is now read-only.

Conflict Folder Already exists #8

Closed
Fabr9193 opened this issue Feb 8, 2017 · 8 comments
Closed

Conflict Folder Already exists #8

Fabr9193 opened this issue Feb 8, 2017 · 8 comments

Comments

@Fabr9193
Copy link

Fabr9193 commented Feb 8, 2017

Hello,

As said in the title I have an issue with your type of return when a folder is already existing, is there a way to "override" your Error Handler without touching your code or do i have to change it ?

Thank you in advance,

Fabricio

@Alorel
Copy link
Owner

Alorel commented Feb 10, 2017

Hi and sorry for the late reply.

I did not add any error handlers to this library. Could you please give me:

  • The full exception stack trace
  • Steps required to reproduce the issue
  • Any system information that might be relevant, e.g. your operating system and PHP version.

@Fabr9193
Copy link
Author

Sure i'll send you this right away

@Fabr9193
Copy link
Author

dropbox error two
dropbox error

What i do here is that i fill a form with my Dropbox developer credentials and i try to create a FolderTree, The first folder is name Inochi but this folder already exists and that's what the code send to me.

I use PHP7 and wamp with MySQL v 5.6.34 Under Windows 10 Anniversary update.

Thanks for your help.

@Alorel
Copy link
Owner

Alorel commented Feb 13, 2017

It's an API error, not a library error. Refer here.

@Alorel Alorel closed this as completed Feb 13, 2017
@Fabr9193
Copy link
Author

Fabr9193 commented Feb 13, 2017

Oh Thanks !
But how I handle this ? Just a Catch of CreateFolderError and i can do what i wish ( like remove the folder for example ? )

@Alorel
Copy link
Owner

Alorel commented Feb 13, 2017

Pretty much sums it up, yes.

@Fabr9193
Copy link
Author

Oh alright i'm pretty new to PHP would that code work ?

catch (DropboxException $exception)
        {
            if ($exception->getCode() == 409)
            {

                dump($exception->getTrace());
                return false;
            }

@Alorel
Copy link
Owner

Alorel commented Feb 13, 2017

I'd check for the exact error as the code might change over time (it's controlled by Dropbox) and/or have multiple errors mapping to the same code.

The basic workflow would be:

  • json_decode the response
  • Check what the exact error is (see attachment)

image

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants