Results 1 to 2 of 2

Thread: ProviderSigninController swallows Exceptions?

  1. #1
    Join Date
    Aug 2011
    Posts
    3

    Default ProviderSigninController swallows Exceptions?

    Is there not a better way to preserve the content of this exception? Either by outputting log message or passing as query param or something?

    Code:
    	@RequestMapping(value="/{providerId}", method=RequestMethod.GET, params="oauth_token")
    	public RedirectView oauth1Callback(@PathVariable String providerId, NativeWebRequest request) {
    		try {
    			OAuth1ConnectionFactory<?> connectionFactory = (OAuth1ConnectionFactory<?>) connectionFactoryLocator.getConnectionFactory(providerId);
    			Connection<?> connection = webSupport.completeConnection(connectionFactory, request);
    			return handleSignIn(connection, request);
    		} catch (Exception e) {
    			return redirect(URIBuilder.fromUri(signInUrl).queryParam("error", "provider").build().toString());
    		}
    	}

  2. #2
    Join Date
    Aug 2004
    Posts
    1,099

    Default

    Log message, certainly. Could possibly pass more info in a query parameter, but the challenge is how to discern any meaningful value for that query parameter from an otherwise generic Exception. (And no, the answer is not to pass the FQE of the exception as a query parameter value.)

    There are a few issues in JIRA already for addressing better error handling around the signin flow. Therefore, there's no need to create a new issue for that. But, if you don't mind, could you create an improvement issue to request that the exception be logged?
    Craig Walls
    Spring Social Project Lead

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •