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

Drop details support in cloud error ResponseError #3611

Open
mstoykov opened this issue Feb 26, 2024 · 0 comments
Open

Drop details support in cloud error ResponseError #3611

mstoykov opened this issue Feb 26, 2024 · 0 comments

Comments

@mstoykov
Copy link
Collaborator

Why?

Currently the parsing of error from the cloud api has some complicated code

k6/cloudapi/errors.go

Lines 47 to 62 in b5a6feb

// `e.Details` is the old API version
// TODO: do not handle `details` when the old API becomes obsolete
var details []string //nolint:prealloc
var detail string
for k, v := range e.Details {
detail = k + ": " + strings.Join(v, ", ")
details = append(details, detail)
}
for k, v := range e.FieldErrors {
detail = k + ": " + strings.Join(v, ", ")
// atm: `details` and `field_errors` could be duplicated
if !contains(details, detail) {
details = append(details, detail)
}
}

Almost all of which is around parsing details which was teh old way the error was returned but has been deprecated and not needed for 5 years.

What?

We can probably just drop most of the code but some testing is needed.

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

No branches or pull requests

1 participant