Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » JGit - Can't get remote's error message from failed push(Error message is lost when a push fails and remote returns a 403)
JGit - Can't get remote's error message from failed push [message #1722090] Tue, 02 February 2016 17:05 Go to next message
Jesse Schulman is currently offline Jesse SchulmanFriend
Messages: 2
Registered: February 2016
Junior Member
I'm on the fence about filing a bug for this, can anyone shed some light on the situation, or would the powers that be tell me to go ahead with a bug?

It seems that when an HTTPS remote returns a non-200 response, in my case 403, that we have no way to get the (very helpful) messages from the remote. Looks like TransportHttp will just throw a TransportException and we lose the remote's messages.

The documentation for OperationResult suggests that the getMessages method could provide "informational or error messages, sent by the remote peer, to help the end-user correct any problems that may have prevented the operation from completing successfully". Unfortunately I never get back a PushResult(OperationResult) from the call() of the PushCommand because it throws the TransportException, and as noted above it appears those messages are never put anywhere and are lost in TransportHttp as it just throws the exception on 403.

I'd really like to surface these messages in my application to the end user, as the only way I figured out their authentication issue was to have them run on the command line where we saw this:

Username for 'https://github.com': *****
Password for 'https://*****@github.com':
remote: You must verify your email address.
remote: See https://github.com/settings/emails.
fatal: unable to access 'https://github.com/*****/test.git/': The requested URL returned error: 403
Re: JGit - Can't get remote's error message from failed push [message #1722386 is a reply to message #1722090] Thu, 04 February 2016 13:47 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
have you tried setOutputStream() to obtain the server messages?

HTH
Rüdiger
--
Rüdiger Herrmann
http://codeaffine.com

On 02.02.2016 18:29, Jesse Schulman wrote:
> I'm on the fence about filing a bug for this, can anyone shed some light
> on the situation, or would the powers that be tell me to go ahead with a
> bug?
>
> It seems that when an HTTPS remote returns a non-200 response, in my
> case 403, that we have no way to get the (very helpful) messages from
> the remote. Looks like TransportHttp will just throw a
> TransportException and we lose the remote's messages.
>
> The documentation for OperationResult suggests that the getMessages
> method could provide "informational or error messages, sent by the
> remote peer, to help the end-user correct any problems that may have
> prevented the operation from completing successfully". Unfortunately I
> never get back a PushResult(OperationResult) from the call() of the
> PushCommand because it throws the TransportException, and as noted above
> it appears those messages are never put anywhere and are lost in
> TransportHttp as it just throws the exception on 403.
>
> I'd really like to surface these messages in my application to the end
> user, as the only way I figured out their authentication issue was to
> have them run on the command line where we saw this:
>
> Username for 'https://github.com': *****
> Password for 'https://*****@github.com':
> remote: You must verify your email address.
> remote: See https://github.com/settings/emails.
> fatal: unable to access 'https://github.com/*****/test.git/': The
> requested URL returned error: 403
Re: JGit - Can't get remote's error message from failed push [message #1722420 is a reply to message #1722386] Thu, 04 February 2016 17:32 Go to previous message
Jesse Schulman is currently offline Jesse SchulmanFriend
Messages: 2
Registered: February 2016
Junior Member
I noticed that method but since it was only on PushCommand and not on FetchCommand I didn't pursue it as it would only provide remote messages for half of the actions. I did just test it and my output stream is empty after the call() and TransportException, so as far as I can tell this doesn't solve either Push or Fetch Commands.
Previous Topic:EGIT/GIT Eclipse contribution : difficulties with setup for 4.2.0 importing egit-developer-tools.p2
Next Topic:How to gc an amazon-s3 remote with jgit?
Goto Forum:
  


Current Time: Thu Apr 18 11:03:51 GMT 2024

Powered by FUDForum. Page generated in 0.02144 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top