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

handle error response and fail fast #7

Closed
grexe opened this issue Nov 13, 2019 · 5 comments
Closed

handle error response and fail fast #7

grexe opened this issue Nov 13, 2019 · 5 comments
Labels
bug Something isn't working v4

Comments

@grexe
Copy link

grexe commented Nov 13, 2019

currently, when the login fails for some reason, it seems the MarkDown parser is still called and consequently returns a followup error message because it cannot parse the real error response:

Unable to upload markdown file, test.md:
	Error checking for existing page: invalid character '<' looking for beginning of value

The real error is printed first, but not handled and the program tries to continue:

RRO[0000] Unable to unmarshal API response. Received: '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><status><status-code>401</status-code><message>Request rejected because issuer is either not authorized or not authorized to impersonate</message></status>'

The way the error is handled is a bit misleading and not very intuitive, as it hides the root cause and it looks as if the file contained a markup error.

@bosborne
Copy link

Seeing the same error, I think it's because my Confluence wiki won't accept user/pass, it only accepts logins using an API token.

@justmiles
Copy link
Owner

You can use API tokens. I need to update the README to explain it, but set your username as the email and the password as an API token generated from https://id.atlassian.com/manage/api-tokens

This issue is definitely warranted, though. It should check auth and fail before trying parse the markdown and upload.

related: #3

@bosborne
Copy link

Works!

@bosborne
Copy link

Minor note: if CONFLUENCE_ENDPOINT has a trailing '/' it does not work, had to remove that.

@justmiles justmiles added the bug Something isn't working label Nov 29, 2019
@finchr
Copy link

finchr commented Dec 30, 2020

Minor note: if CONFLUENCE_ENDPOINT has a trailing '/' it does not work, had to remove that.

Thanks! This solved it for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v4
Projects
None yet
Development

No branches or pull requests

4 participants