Comments (3)
I probably just need a way to get the $rawResponse I think.
I'm using this code to upload a file
'''
$result = $dropbox->upload($dropboxFile,$dropboxDir.$uploadname);
'''
And the error is thrown in the send method (obviously). But would the $rawReponse be available in the $result if the send() method fails?
from dropbox-php-sdk.
@SneakyDave I tried reproducing the bug, but the exception being thrown contains an error message at all times. However, the error message depends on the type of the error (https://www.dropbox.com/developers/documentation/http/documentation#error-handling). Therefore, I might need more information to reproduce the bug.
What error/exception message and response code are you being shown when calling the upload()
method fails? Can you try and reproduce this bug with the following code:
$file = __DIR__ . "/hello.txt"; // Replace this with a path to an existing file
try {
// Upload the file with an invalid mode. Valid modes are: add, overwrite and update
var_dump($dropbox->upload($file, "/hello.txt", ['mode' => 'invalid-mode']));
} catch (Exception $e) {
echo $e->getMessage();
}
This should show the following error message:
Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": mode: unknown tag 'invalid-mode'
Thanks.
from dropbox-php-sdk.
It isn't a consistent error. It's part of an addon I wrote for XenForo that uploads a backup file of a XenForo installation to DropBox, and users of the addon have reported that once in a while, using the addon will return an error from the GuzzleHttpClient on the upload method:
https://xenforo.com/community/threads/solidmean-forumbackup-dropbox-upload-paid.102856/page-4#post-1093298
I was just curious if there was a way to better trap the error message, because right now, it just throws the exception.
But let me look at my code, maybe I don't have a try/catch, and not getting the exception message.
from dropbox-php-sdk.
Related Issues (20)
- how to make shared link password protected HOT 1
- settings.expires: time data does not match format '%Y-%m-%dT%H:%M:%SZ' HOT 1
- Fatal error: Uncaught GuzzleHttp
- Is it in plan to implement short-lived auth tokens? HOT 7
- How to assign a description to a file
- how to deal with dropbox business account HOT 1
- failed to install due to guzzlehttp/guzzle
- Error: Call to undefined function GuzzleHttp\Psr7\stream_for() and php 8.1 HOT 4
- tightenco/collect is backdated HOT 2
- Call to undefined function GuzzleHttp\Psr7\stream_for() HOT 4
- Fatal Error: Uncaught GuzzleHttp\Exception\ServerException
- How to get a autoload file ?
- getRefreshedAccessToken not working HOT 1
- How to use getRefreshedAccessToken ? HOT 4
- Write and Read Comments
- Short-lived Access Token and Refresh Token , HOW TO DO IT? HOT 2
- json encoding of parameters HOT 1
- Setting Dropbox-API-Path-Root Header to Access Team Folders HOT 4
- We were not successful at all HOT 1
- I couldn't upload any files to Dropbox, I wonder what's the problem? HOT 2
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 dropbox-php-sdk.