How catch a Unauthorized Exception on Open

Aug 9, 2011 at 3:53 PM

Hi Guys,

I'm trying to catch the Unauthorized exception on CloudStorage.Open(). The attempt is to understand if a user has revoked the permission to access to dropbox folders.

What I see now is that I receive the Exception:

'AppLimit.CloudComputing.SharpBox.Exceptions.SharpBoxException' occurred in AppLimit.CloudComputing.SharpBox.Net40.dll

Additional information: Couldn't retrieve child elements from the server

 

Any idea about how understand that the permission is revoked?

 

Thanks in advance

Tonio

Coordinator
Aug 9, 2011 at 5:07 PM
Hi,

this looks like you have access permissions to the service but it was not possible to retrieve the root element. Which service are using (DropBox, Box.NET, WebDAV, ...)

Thanks
Dirk


2011/8/9 tonioplex <notifications@codeplex.com>

From: tonioplex

Hi Guys,

I'm trying to catch the Unauthorized exception on CloudStorage.Open(). The attempt is to understand if a user has revoked the permission to access to dropbox folders.

What I see now is that I receive the Exception:

'AppLimit.CloudComputing.SharpBox.Exceptions.SharpBoxException' occurred in AppLimit.CloudComputing.SharpBox.Net40.dll

Additional information: Couldn't retrieve child elements from the server

Any idea about how understand that the permission is revoked?

Thanks in advance

Tonio

Read the full discussion online.

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

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

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings 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


Aug 10, 2011 at 10:15 AM

Hi,

I'm using DropBox.

 

What I did was:

1. subscribe to my app

2. test that it works

3. delete my app from the list of of granted apps in my user account (so I got the error I expected was something like "Unauthorized")

 

I tryed to debug. I found that a "System.Net.WebException" with a description containing a server error 401 is catched in

public static WebResponse GetResponse(WebRequest request) (source file "WebRequestStreamHelper.cs)

after that the error is thrown to... PerformWebRequest2 in (WebRequestService.cs)

that catch the WebException and returns null... so the real reason of the problem is lost. I see that the error is saved in a "out variable" but is there any way to retrieve it?

I'm trying to understand... but if you have the answer... please help me, thanks :-)

Coordinator
Aug 10, 2011 at 10:54 PM
Hi,

yes you are totally right. With check in http://sharpbox.codeplex.com/SourceControl/changeset/changes/78079 I added a fix.

Thanks a lot for your feedback
Dirk

2011/8/10 tonioplex <notifications@codeplex.com>

From: tonioplex

Hi,

I'm using DropBox.

What I did was:

1. subscribe to my app

2. test that it works

3. delete my app from the list of of granted apps in my user account (so I got the error I expected was something like "Unauthorized")

I tryed to debug. I found that a "System.Net.WebException" with a description containing a server error 401 is catched in

public static WebResponse GetResponse(WebRequest request) (source file "WebRequestStreamHelper.cs)

after that the error is thrown to... PerformWebRequest2 in (WebRequestService.cs)

that catch the WebException and returns null... so the real reason of the problem is lost. I see that the error is saved in a "out variable" but is there any way to retrieve it?

I'm trying to understand... but if you have the answer... please help me, thanks :-)

Read the full discussion online.

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

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

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings 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


Aug 12, 2011 at 2:35 PM

Perfect. It works!

Thanks a lot

Tonio