opa-envoy-plugin icon indicating copy to clipboard operation
opa-envoy-plugin copied to clipboard

Specific response assertion error messages

Open PietervdWerk opened this issue 9 months ago • 3 comments

I've been getting the error "failed to get response body: type assertion error" and it took me quite a while to figure out what the problem was. I've copied my policy into a playground and it worked fine there (in hindsight that's obvious).

I propose a more verbose and specific error message when assertion fails. I've taken the liberty to come with some suggestions.

PietervdWerk avatar May 02 '24 10:05 PietervdWerk

I've updated the error messages to be "expected x, got y". Let me me know what you think :).

PietervdWerk avatar May 08 '24 13:05 PietervdWerk

@PietervdWerk this would be a good change to get in. Are you able to update the tests?

ashutosh-narkar avatar May 13 '24 15:05 ashutosh-narkar

Yes tomorrow! (I had a few days off, back to work tomorrow.)

PietervdWerk avatar May 13 '24 15:05 PietervdWerk