Exceptions from Document._Upload

Developer
Jun 3, 2011 at 2:13 PM

I had a bug in my code that uses the Document.Upload method today, whereby the upload was failing because the file name passed in the "url" property hadn't escaped spaces in the url properly as %20.  That's fine though, I wouldn't expect the API to handle that, it's up to consumers to pass in valid URLs.  However, to find the cause of the problem I had to do a debug build of the API assemblies and step into the upload method.  Have you considered checking the response for errors when it comes back?  At the moment you're returned a document with Id = 0 and, as far as I can tell, you loose the details of the error that was returned by the API.

Would be great if it threw an exception with the error details, or different exception types based on the type of error that comes back, so they can be handled differently by the consuming code.  E.g. throw an ScribdInvalidDocumentUrlException if you get an Invalid Url error back.

Aside: Are you looking for any new members to the project?  I'm working for a company using the API in our application, so I'd like to support the project.

Coordinator
Jun 3, 2011 at 3:06 PM

pbeams:

I've added you to the project.  Currently, you should be able to subscribe to the Scribd.Net.Service.Error event to receive the exceptions returned by the Scribd API service.

- Paul

Developer
Jun 3, 2011 at 3:45 PM
Thanks Paul - I missed that event, useful for logging off errors.

On Fri, Jun 3, 2011 at 4:06 PM, JPaulDuncan <notifications@codeplex.com> wrote:

From: JPaulDuncan

pbeams:

I've added you to the project. Currently, you should be able to subscribe to the Scribd.Net.Service.Error event to receive the exceptions returned by the Scribd API service.

- Paul

Read the full discussion online.

To add a post to this discussion, reply to this email (scribdnet@discussions.codeplex.com)

To start a new discussion for this project, email scribdnet@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com