Lewuathe / dropbox-github-action

Apache License 2.0
4 stars 2 forks source link

Action fails silently #3

Open anapaulagomes opened 2 weeks ago

anapaulagomes commented 2 weeks ago

Thanks for putting this action together! It would be nice to have it fail when an error is returned from the curl command. A few examples here:

{"error_summary": "missing_scope/.", "error": {".tag": "missing_scope", "required_scope": "files.content.write"}}
{"error_summary": "path/conflict/folder/..", "error": {".tag": "path", "reason": {".tag": "conflict", "conflict": {".tag": "folder"}}, "upload_session_id": "pid_upload_session:xxx-uuu"}}
marksteward commented 5 days ago

It should also check the output of /oauth2/token:

{"error": "invalid_grant", "error_description": "refresh token is malformed"}
{"error": "invalid_client: Invalid client_id or client_secret"}

vs

{"access_token": "sl....", "token_type": "bearer", "expires_in": 14400}
marksteward commented 5 days ago

And the requests I'm seeing currently don't reply with JSON for most errors, e.g.:

Error in call to API function "files/upload": Must provide HTTP header "Authorization" or URL parameter "authorization".
Error in call to API function "files/upload": Invalid authorization value in HTTP header "Authorization": "...".  Expecting "Bearer <oauth2-access-token>
Error in call to API function "files/upload": HTTP header "Dropbox-API-Arg": path: The root folder is unsupported.

This might only be the upload endpoint, perhaps because it's not using application/json in the request?