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

error property on Error object is sometimes a string #145

Closed
jvilk opened this issue Jul 23, 2017 · 4 comments · Fixed by #406
Closed

error property on Error object is sometimes a string #145

jvilk opened this issue Jul 23, 2017 · 4 comments · Fixed by #406

Comments

@jvilk
Copy link

jvilk commented Jul 23, 2017

Version: 2.5.7

The error property on Error objects is supposed to be an object. However, it is sometimes a string.

In addition, both the user_message and error_summary fields are missing on the Error object.

I am very worried now that my Dropbox code will randomly fail because server messages fail to correspond to the appropriate Stone data type. I'm not feeling too good about the switch to V2.

Example

Code:

client.filesGetMetadata({ path: "" }).catch(function(e) {
  console.log(typeof(e.error));
  console.log(e.error);
});

Output:

"string"
"Error in call to API function "files/get_metadata": request body: path: The root folder is unsupported."

Expectation:

e.error is a GetMetadataErrorPath (which is what the documentation says it should be).

Expected output:

"object"
{ '.tag': 'path', path: { /* a LookupError */ }}
@jvilk
Copy link
Author

jvilk commented Jul 23, 2017

Here's another example for create folder. e.error is the following string:

"Error in call to API function "files/create_folder": request body: path: 'tmp' did not match pattern '(/(.|[\r\n]))|(ns:[0-9]+(/.)?)'"

@jvilk
Copy link
Author

jvilk commented Jul 23, 2017

Another, from filesUpload (this is a string, not an object):

"{"error_summary": "too_many_write_operations/", "error": {"reason": {".tag": "too_many_write_operations"}}}"

@greg-db
Copy link
Contributor

greg-db commented Jul 24, 2017

Thanks for the report! We're looking into it.

@rogebrd rogebrd linked a pull request Nov 2, 2020 that will close this issue
7 tasks
@greg-db
Copy link
Contributor

greg-db commented Nov 13, 2020

We've updated the error handling in release v8.0.0, and added a note to the Upgrading document. Please upgrade to the latest version and let us know if you're still seeing any issues. Thanks!

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

Successfully merging a pull request may close this issue.

2 participants