Comments (2)
The best thing to do is catch the GuzzleHttp\Exception\ClientException
exception Guzzle throws when you attempt to create an album that already exists with that name, adjust the name by appending 1 to the number and try again.
For example:
try {
$response = $client->post('folder/user/example/Cats!albums', $options);
} catch (GuzzleHttp\Exception\ClientException $e) {
if ($e->getCode() == 409) {
// retry code here
};
}
You may want to put this in a for or while loop to keep incrementing until you finally get a unique name.
from phpsmug.
I'm gonna take the silence on this issue as confirmation that you're resolved all your issues and I've answered all your questions. If you have any further issues or questions, please feel free to open a new issue.
from phpsmug.
Related Issues (20)
- Trying to access unlisted children of root node with phpSmug HOT 2
- Debugging 400 response HOT 2
- Sorting Albums by Date Added Decending HOT 4
- Undefined offset in Client.php __call() caused by empty URI arguments HOT 3
- Can't upload (from URI & from Local) HOT 2
- $callback url doesn't work! HOT 5
- Problems with phpSmug 3.5 and API 1.3 HOT 4
- Problems with expansions HOT 1
- Is this project abandoned? HOT 2
- Feature request: support for _config HOT 1
- Keywords not showing up? HOT 1
- setToken problems using own account credentials HOT 2
- 400 Error code creating album, please help. HOT 4
- list all folders HOT 3
- 404 returned just for our Smugmug site album list HOT 2
- Undefined Property / and Class 'phpSmug\Client' not found HOT 2
- Saving/Reusing the Token HOT 4
- nonce_used error when getting image information HOT 5
- Issue updating keywords HOT 2
- Access headers in response HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from phpsmug.