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

Feature Request: export NoRedirectPolicy's error #569

Closed
trim21 opened this issue Jul 28, 2022 · 1 comment · Fixed by #637
Closed

Feature Request: export NoRedirectPolicy's error #569

trim21 opened this issue Jul 28, 2022 · 1 comment · Fixed by #637
Assignees

Comments

@trim21
Copy link

trim21 commented Jul 28, 2022

this is what we do to know it's a redirect problem:

	resp, err := h.R().SetResult(&r).Get(...)
	if err != nil {
		if err.Error() == "auto redirect is disabled" {
			return APISubject{}, errSkip
		}
		panic(err)
	}

if the error of NoRedirectPolicy is exported, we can use errors.Is(err, resty.ErrNotAllowed) to match the error.

@jeevatkm jeevatkm added this to the v2.8.0 Milestone milestone Mar 6, 2023
@jeevatkm
Copy link
Member

jeevatkm commented Mar 6, 2023

@trim21 I'm sorry for the delayed attention here. Thanks for reaching out, it makes sense to export the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants