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

Build issues undefined: "github.com/corestoreio/errors".NewWriteFailed #1

Open
shift opened this issue May 23, 2018 · 3 comments
Open
Labels

Comments

@shift
Copy link

shift commented May 23, 2018

Unable to build. The following errors are produced.

# github.com/corestoreio/caddy-esi/esitag
../../../corestoreio/caddy-esi/esitag/data_tag.go:121:20: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:155:23: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:177:24: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:183:24: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:190:25: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:199:24: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:205:24: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:211:24: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:222:23: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:228:23: undefined: "github.com/corestoreio/errors".NewWriteFailed
../../../corestoreio/caddy-esi/esitag/data_tag.go:228:23: too many errors
@SchumacherFM
Copy link
Member

That won't get fixed too soon.

@ghost
Copy link

ghost commented Feb 2, 2019

hey @SchumacherFM
It looks pretty interesting in terms of the architecture using ESI tags and a Caddy proxy.

Regarding the errors, i can se what your trying to do in terms of returning errors with context designed for ESI ( i assume ). It looks like only one file has then, so maybe for now we can just wrap the calling code to return normal errors OR ESI style errors.

How the code is now:

if dts.Len() == 0 || dataLen == 0 {
		wn, err := w.Write(data)
		nWritten += wn

		return nWritten, errors.NewWriteFailed(err, "[esitag] Failed to write")
	}

Suggested quick fix:

var useEsiError = true

	if dts.Len() == 0 || dataLen == 0 {
		wn, err := w.Write(data)
		nWritten += wn
		if useEsiError {

			//TODO: return nWritten, errors.NewWriteFailed(err, "[esitag] Failed to write")
		}
		return nWritten, errors.WithMessage(err, "[esitag] Failed to write")
	}

This is just to stub out the code thats stopping compilation for now.
I think its maybe 10 to 15 locations in that one file.

@SchumacherFM
Copy link
Member

Hi @gedw99

thanks for looking into this. But it needs a total refactor instead of commenting out the old code.

I've refactored the errors and the code does now compile but there are architectural errors because of the changed caddy middlewares. So caddy-esi does not work as expected.

I might be looking into this in the next couple of months.

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

No branches or pull requests

2 participants