Repository: goadesign/goa
Pull request #3150 (2022-09-26 11:03:19)

Bump actions/stale from 5 to 6
Bumps [actions/stale](https://github.com/actions/stale) from 5 to 6.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/releases">actions/stale's releases</a>.</em></p>
<blockquote>
<h2>v6.0.0</h2>
<p>:warning: Breaking change :warning:</p>
<p>Issues/PRs default <code>close-issue-reason</code> is now <code>not_planned</code>(<a href="https://github-redirect.dependabot.com/actions/stale/issues/789">#789</a>)</p>
<h2>V5.2.0</h2>
<p>Features:
New option <code>include-only-assigned</code> enables users to process only issues/PRs that are already assigned. If there is no assignees and this option is set, issue will not be processed per: <a href="https://github-redirect.dependabot.com/actions/stale/issues/596">issue/596</a></p>
<p>Fixes:
Fix date comparison edge case <a href="https://github-redirect.dependabot.com/actions/stale/pull/816">PR/816</a></p>
<p>Dependency Updates:
<a href="https://github-redirect.dependabot.com/actions/stale/pull/812">PR/812</a></p>
<h2>Fix issue when days-before-close is more than days-before-stale</h2>
<p>fixes a bug introduced in <a href="https://github-redirect.dependabot.com/actions/stale/issues/717">#717</a></p>
<p>fixed in <a href="https://github-redirect.dependabot.com/actions/stale/issues/775">#775</a></p>
<h2>v5.1.0</h2>
<h1>[5.1.0]</h1>
<p><a href="https://github-redirect.dependabot.com/actions/stale/issues/696">Don't process stale issues right after they're marked stale</a>
Add close-issue-reason option <a href="https://github-redirect.dependabot.com/actions/stale/pull/764">#764</a><a href="https://github-redirect.dependabot.com/actions/stale/pull/772">#772</a>
Various dependabot/dependency updates</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/actions/stale/blob/main/CHANGELOG.md">actions/stale's changelog</a>.</em></p>
<blockquote>
<h1>Changelog</h1>
<h1>[6.0.0]</h1>
<p>:warning: Breaking change :warning:</p>
<p>Issues/PRs default <code>close-issue-reason</code> is now <code>not_planned</code>(<a href="https://github-redirect.dependabot.com/actions/stale/issues/789">#789</a>)</p>
<h1>[5.1.0]</h1>
<p><a href="https://github-redirect.dependabot.com/actions/stale/issues/696">Don't process stale issues right after they're marked stale</a>
[Add close-issue-reason option]<a href="https://github-redirect.dependabot.com/actions/stale/pull/764">#764</a><a href="https://github-redirect.dependabot.com/actions/stale/pull/772">#772</a>
Various dependabot/dependency updates</p>
<h2><a href="https://github.com/actions/stale/compare/v3.0.19...v4.1.0">4.1.0</a> (2021-07-14)</h2>
<h2>Features</h2>
<ul>
<li><a href="https://github.com/actions/stale/commit/9912fa74d1c01b5d6187793d97441019cbe325d0">Ability to exempt draft PRs</a></li>
</ul>
<h2><a href="https://github.com/actions/stale/compare/v3.0.19...v4.0.0">4.0.0</a> (2021-07-14)</h2>
<h3>Features</h3>
<ul>
<li><strong>options:</strong> simplify config by removing skip stale message options (<a href="https://github-redirect.dependabot.com/actions/stale/issues/457">#457</a>) (<a href="https://github.com/actions/stale/commit/6ec637d238067ab8cc96c9289dcdac280bbd3f4a">6ec637d</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/405">#405</a> <a href="https://github-redirect.dependabot.com/actions/stale/issues/455">#455</a></li>
<li><strong>output:</strong> print output parameters (<a href="https://github-redirect.dependabot.com/actions/stale/issues/458">#458</a>) (<a href="https://github.com/actions/stale/commit/3e6d35b685f0b2fa1a69be893fa07d3d85e05ee0">3e6d35b</a>)</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li><strong>dry-run:</strong> forbid mutations in dry-run (<a href="https://github-redirect.dependabot.com/actions/stale/issues/500">#500</a>) (<a href="https://github.com/actions/stale/commit/f1017f33dd159ea51366375120c3e6981d7c3097">f1017f3</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/499">#499</a></li>
<li><strong>logs:</strong> coloured logs (<a href="https://github-redirect.dependabot.com/actions/stale/issues/465">#465</a>) (<a href="https://github.com/actions/stale/commit/5fbbfba142860ea6512549e96e36e3540c314132">5fbbfba</a>)</li>
<li><strong>operations:</strong> fail fast the current batch to respect the operations limit (<a href="https://github-redirect.dependabot.com/actions/stale/issues/474">#474</a>) (<a href="https://github.com/actions/stale/commit/5f6f311ca6aa75babadfc7bac6edf5d85fa3f35d">5f6f311</a>), closes <a href="https://github-redirect.dependabot.com/actions/stale/issues/466">#466</a></li>
<li><strong>label comparison</strong>: make label comparison case insensitive <a href="https://github-redirect.dependabot.com/actions/stale/pull/517">#517</a>, closes <a href="https://github-redirect.dependabot.com/actions/stale/pull/516">#516</a></li>
<li><strong>filtering comments by actor could have strange behavior</strong>: &quot;stale&quot; comments are now detected based on if the message is the stale message not <em>who</em> made the comment(<a href="https://github-redirect.dependabot.com/actions/stale/pull/519">#519</a>), fixes <a href="https://github-redirect.dependabot.com/actions/stale/pull/441">#441</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/509">#509</a>, <a href="https://github-redirect.dependabot.com/actions/stale/pull/518">#518</a></li>
</ul>
<h3>Breaking Changes</h3>
<ul>
<li>The options <code>skip-stale-issue-message</code> and <code>skip-stale-pr-message</code> were removed. Instead, setting the options <code>stale-issue-message</code> and <code>stale-pr-message</code> will be enough to let the stale workflow add a comment. If the options are unset, a comment will not be added which was the equivalent of setting <code>skip-stale-issue-message</code> to <code>true</code>.</li>
<li>The <code>operations-per-run</code> option will be more effective. After migrating, you could face a failed-fast process workflow if you let the default value (30) or set it to a small number. In that case, you will see a warning at the end of the logs (if enabled) indicating that the workflow was stopped sooner to avoid consuming too much API calls. In most cases, you can just increase this limit to make sure to process everything in a single run.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/actions/stale/commit/3de2653986ebd134983c79fe2be5d45cc3d9f4e1"><code>3de2653</code></a> Update changelog for v6.0.0 (<a href="https://github-redirect.dependabot.com/actions/stale/issues/829">#829</a>)</li>
<li><a href="https://github.com/actions/stale/commit/02e44c81cc3144e8817a5686f3d7c24658f6f1e6"><code>02e44c8</code></a> fix(options)!: Make <code>not_planned</code> the default <code>close-issue-reason</code> (<a href="https://github-redirect.dependabot.com/actions/stale/issues/807">#807</a>)</li>
<li>See full diff in <a href="https://github.com/actions/stale/compare/v5...v6">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=actions/stale&package-manager=github_actions&previous-version=5&new-version=6)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml
index 1a079587..84b06d47 100644
--- a/.github/workflows/stale.yml
+++ b/.github/workflows/stale.yml
@@ -18,7 +18,7 @@ jobs:
       pull-requests: write
 
     steps:
-    - uses: actions/stale@v5
+    - uses: actions/stale@v6
       with:
         days-before-issue-stale: 60
         days-before-pr-stale: 90
diff --git a/codegen/service/service.go b/codegen/service/service.go
index 1c525792..f1207579 100644
--- a/codegen/service/service.go
+++ b/codegen/service/service.go
@@ -390,7 +390,14 @@ func (e {{ .Ref }}) Error() string {
 }
 
 // ErrorName returns {{ printf "%q" .Name }}.
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e {{ .Ref }}) ErrorName() string {
+	return e.GoaErrorName()
+}
+
+// GoaErrorName returns {{ printf "%q" .Name }}.
+func (e {{ .Ref }}) GoaErrorName() string {
 	return {{ errorName . }}
 }
 `
diff --git a/grpc/codegen/server.go b/grpc/codegen/server.go
index f13c2dc0..7866fa23 100644
--- a/grpc/codegen/server.go
+++ b/grpc/codegen/server.go
@@ -208,9 +208,23 @@ type {{ .ServerStruct }} struct {
 
 // ErrorNamer is an interface implemented by generated error structs that
 // exposes the name of the error as defined in the expr.
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 type ErrorNamer interface {
   ErrorName() string
 }
+
+// GoaErrorNamer is an interface implemented by generated error structs that
+// exposes the name of the error as defined in the design.
+type GoaErrorNamer interface {
+	GoaErrorName() string
+}
+
+type adaptErrorNamer ErrorName
+
+func (err adaptErrorNamer) GoaErrorName() string {
+	return err.ErrorName()
+}
 `
 
 // input: ServiceData
@@ -266,9 +280,13 @@ func (s *{{ .ServerStruct }}) {{ .Method.VarName }}(
 {{- define "handle_error" }}
 	if err != nil {
 	{{- if .Errors }}
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if errors.As(err, &en) {
-			switch en.ErrorName() {
+			switch en.GoaErrorName() {
 		{{- range .Errors }}
 			case {{ printf "%q" .Name }}:
 				{{- if .Response.ServerConvert }}
diff --git a/http/codegen/server.go b/http/codegen/server.go
index faacd810..be294eb6 100644
--- a/http/codegen/server.go
+++ b/http/codegen/server.go
@@ -279,9 +279,23 @@ type {{ .ServerStruct }} struct {
 
 // ErrorNamer is an interface implemented by generated error structs that
 // exposes the name of the error as defined in the design.
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 type ErrorNamer interface {
 	ErrorName() string
 }
+
+// GoaErrorNamer is an interface implemented by generated error structs that
+// exposes the name of the error as defined in the design.
+type GoaErrorNamer interface {
+	GoaErrorName() string
+}
+
+type adaptErrorNamer ErrorName
+
+func (err adaptErrorNamer) GoaErrorName() string {
+	return err.ErrorName()
+}
 `
 
 // input: ServiceData
@@ -694,7 +708,7 @@ const requestElementsT = `{{- define "request_elements" }}
 			{{ .VarName }} = []string{
                 {{- range $i, $v := .DefaultValue }}
                     {{- if $i }}{{ print ", " }}{{ end }}
-                    {{- printf "%q" $v -}} 
+                    {{- printf "%q" $v -}}
                 {{- end -}} }
 		}
 		{{- end }}
@@ -1203,11 +1217,15 @@ const errorEncoderT = `{{ printf "%s returns an encoder for errors returned by t
 func {{ .ErrorEncoder }}(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 	{{- range $gerr := .Errors }}
 	{{- range $err := .Errors }}
 		case {{ printf "%q" .Name }}:
@@ -1350,7 +1368,7 @@ const responseT = `{{ define "response" -}}
 	{{- end }}
 
 	{{- if .ErrorHeader }}
-	w.Header().Set("goa-error", res.ErrorName())
+	w.Header().Set("goa-error", res.GoaErrorName())
 	{{- end }}
 	w.WriteHeader({{ .StatusCode }})
 {{- end }}
diff --git a/pkg/error.go b/pkg/error.go
index b057f99c..3d4c12b3 100644
--- a/pkg/error.go
+++ b/pkg/error.go
@@ -245,8 +245,13 @@ func (e ServiceError) History() []ServiceError {
 func (e *ServiceError) Error() string { return e.Message }
 
 // ErrorName returns the error name.
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e *ServiceError) ErrorName() string { return e.Name }
 
+// GoaErrorName returns the error name.
+func (e *ServiceError) GoaErrorName() string { return e.ErrorName() }
+
 func (e *ServiceError) Unwrap() error { return e.err }
 
 func withField(field string, err *ServiceError) *ServiceError {


Test patch:
diff --git a/codegen/service/testdata/service_code.go b/codegen/service/testdata/service_code.go
index e3ab82a6..693b044c 100644
--- a/codegen/service/testdata/service_code.go
+++ b/codegen/service/testdata/service_code.go
@@ -407,7 +407,14 @@ func (e *APayload) Error() string {
 }
 
 // ErrorName returns "APayload".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e *APayload) ErrorName() string {
+	return e.GoaErrorName()
+}
+
+// GoaErrorName returns "APayload".
+func (e *APayload) GoaErrorName() string {
 	return "user_type"
 }
 
@@ -417,7 +424,14 @@ func (e *Result) Error() string {
 }
 
 // ErrorName returns "Result".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e *Result) ErrorName() string {
+	return e.GoaErrorName()
+}
+
+// GoaErrorName returns "Result".
+func (e *Result) GoaErrorName() string {
 	return e.B
 }
 
@@ -427,7 +441,14 @@ func (e Primitive) Error() string {
 }
 
 // ErrorName returns "primitive".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e Primitive) ErrorName() string {
+	return e.GoaErrorName()
+}
+
+// GoaErrorName returns "primitive".
+func (e Primitive) GoaErrorName() string {
 	return "primitive"
 }
 `
@@ -459,7 +480,14 @@ func (e *GoaError) Error() string {
 }
 
 // ErrorName returns "GoaError".
+//
+// Deprecated: Use GoaErrorName - https://github.com/goadesign/goa/issues/3105
 func (e *GoaError) ErrorName() string {
+	return e.GoaErrorName()
+}
+
+// GoaErrorName returns "GoaError".
+func (e *GoaError) GoaErrorName() string {
 	return e.ErrorCode
 }
 `
diff --git a/grpc/codegen/testdata/server_interface_code.go b/grpc/codegen/testdata/server_interface_code.go
index ffcd59a7..e5cb7974 100644
--- a/grpc/codegen/testdata/server_interface_code.go
+++ b/grpc/codegen/testdata/server_interface_code.go
@@ -58,9 +58,13 @@ func (s *Server) MethodUnaryRPCWithErrors(ctx context.Context, message *service_
 	ctx = context.WithValue(ctx, goa.ServiceKey, "ServiceUnaryRPCWithErrors")
 	resp, err := s.MethodUnaryRPCWithErrorsH.Handle(ctx, message)
 	if err != nil {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if errors.As(err, &en) {
-			switch en.ErrorName() {
+			switch en.GoaErrorName() {
 			case "timeout":
 				return nil, goagrpc.NewStatusError(codes.Canceled, err, goagrpc.NewErrorResponse(err))
 			case "internal":
@@ -92,9 +96,13 @@ func (s *Server) MethodUnaryRPCWithOverridingErrors(ctx context.Context, message
 	ctx = context.WithValue(ctx, goa.ServiceKey, "ServiceUnaryRPCWithOverridingErrors")
 	resp, err := s.MethodUnaryRPCWithOverridingErrorsH.Handle(ctx, message)
 	if err != nil {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if errors.As(err, &en) {
-			switch en.ErrorName() {
+			switch en.GoaErrorName() {
 			case "overridden":
 				return nil, goagrpc.NewStatusError(codes.Unknown, err, goagrpc.NewErrorResponse(err))
 			case "internal":
@@ -231,9 +239,13 @@ func (s *Server) MethodBidirectionalStreamingRPCWithErrors(stream service_bidire
 	ctx = context.WithValue(ctx, goa.ServiceKey, "ServiceBidirectionalStreamingRPCWithErrors")
 	_, err := s.MethodBidirectionalStreamingRPCWithErrorsH.Decode(ctx, nil)
 	if err != nil {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if errors.As(err, &en) {
-			switch en.ErrorName() {
+			switch en.GoaErrorName() {
 			case "timeout":
 				return goagrpc.NewStatusError(codes.Canceled, err, goagrpc.NewErrorResponse(err))
 			case "internal":
@@ -249,9 +261,13 @@ func (s *Server) MethodBidirectionalStreamingRPCWithErrors(stream service_bidire
 	}
 	err = s.MethodBidirectionalStreamingRPCWithErrorsH.Handle(ctx, ep)
 	if err != nil {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if errors.As(err, &en) {
-			switch en.ErrorName() {
+			switch en.GoaErrorName() {
 			case "timeout":
 				return goagrpc.NewStatusError(codes.Canceled, err, goagrpc.NewErrorResponse(err))
 			case "internal":
diff --git a/http/codegen/testdata/error_encoder_code.go b/http/codegen/testdata/error_encoder_code.go
index 6a412385..861e5d0e 100644
--- a/http/codegen/testdata/error_encoder_code.go
+++ b/http/codegen/testdata/error_encoder_code.go
@@ -6,17 +6,21 @@ var PrimitiveErrorResponseEncoderCode = `// EncodeMethodPrimitiveErrorResponseEr
 func EncodeMethodPrimitiveErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res serviceprimitiveerrorresponse.BadRequest
 			errors.As(v, &res)
 			enc := encoder(ctx, w)
 			body := res
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		case "internal_error":
@@ -24,7 +28,7 @@ func EncodeMethodPrimitiveErrorResponseError(encoder func(context.Context, http.
 			errors.As(v, &res)
 			enc := encoder(ctx, w)
 			body := res
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return enc.Encode(body)
 		default:
@@ -40,11 +44,15 @@ var PrimitiveErrorInResponseHeaderEncoderCode = `// EncodeMethodPrimitiveErrorIn
 func EncodeMethodPrimitiveErrorInResponseHeaderError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res serviceprimitiveerrorinresponseheader.BadRequest
 			errors.As(v, &res)
@@ -53,7 +61,7 @@ func EncodeMethodPrimitiveErrorInResponseHeaderError(encoder func(context.Contex
 				string_s := val
 				w.Header().Set("String", string_s)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return nil
 		case "internal_error":
@@ -64,7 +72,7 @@ func EncodeMethodPrimitiveErrorInResponseHeaderError(encoder func(context.Contex
 				int_s := strconv.Itoa(val)
 				w.Header().Set("Int", int_s)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return nil
 		default:
@@ -80,11 +88,15 @@ var APIPrimitiveErrorResponseEncoderCode = `// EncodeMethodAPIPrimitiveErrorResp
 func EncodeMethodAPIPrimitiveErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "internal_error":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -95,7 +107,7 @@ func EncodeMethodAPIPrimitiveErrorResponseError(encoder func(context.Context, ht
 			} else {
 				body = NewMethodAPIPrimitiveErrorResponseInternalErrorResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return enc.Encode(body)
 		case "bad_request":
@@ -103,7 +115,7 @@ func EncodeMethodAPIPrimitiveErrorResponseError(encoder func(context.Context, ht
 			errors.As(v, &res)
 			enc := encoder(ctx, w)
 			body := res
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		default:
@@ -118,11 +130,15 @@ var DefaultErrorResponseEncoderCode = `// EncodeMethodDefaultErrorResponseError
 func EncodeMethodDefaultErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -133,7 +149,7 @@ func EncodeMethodDefaultErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodDefaultErrorResponseBadRequestResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		default:
@@ -148,11 +164,15 @@ var DefaultErrorResponseWithContentTypeEncoderCode = `// EncodeMethodDefaultErro
 func EncodeMethodDefaultErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -164,7 +184,7 @@ func EncodeMethodDefaultErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodDefaultErrorResponseBadRequestResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		default:
@@ -179,11 +199,15 @@ var ServiceErrorResponseEncoderCode = `// EncodeMethodServiceErrorResponseError
 func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "internal_error":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -194,7 +218,7 @@ func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodServiceErrorResponseInternalErrorResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return enc.Encode(body)
 		case "bad_request":
@@ -207,7 +231,7 @@ func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodServiceErrorResponseBadRequestResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		default:
@@ -222,11 +246,15 @@ var ServiceErrorResponseWithContentTypeEncoderCode = `// EncodeMethodServiceErro
 func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "internal_error":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -237,7 +265,7 @@ func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodServiceErrorResponseInternalErrorResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return enc.Encode(body)
 		case "bad_request":
@@ -251,7 +279,7 @@ func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.Re
 			} else {
 				body = NewMethodServiceErrorResponseBadRequestResponseBody(res)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return enc.Encode(body)
 		default:
@@ -266,18 +294,22 @@ var NoBodyErrorResponseEncoderCode = `// EncodeMethodServiceErrorResponseError r
 func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res *servicenobodyerrorresponse.StringError
 			errors.As(v, &res)
 			if res.Header != nil {
 				w.Header().Set("Header", *res.Header)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return nil
 		default:
@@ -292,11 +324,15 @@ var NoBodyErrorResponseWithContentTypeEncoderCode = `// EncodeMethodServiceError
 func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "bad_request":
 			var res *servicenobodyerrorresponse.StringError
 			errors.As(v, &res)
@@ -304,7 +340,7 @@ func EncodeMethodServiceErrorResponseError(encoder func(context.Context, http.Re
 			if res.Header != nil {
 				w.Header().Set("Header", *res.Header)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusBadRequest)
 			return nil
 		default:
@@ -320,11 +356,15 @@ var EmptyErrorResponseBodyEncoderCode = `// EncodeMethodEmptyErrorResponseBodyEr
 func EncodeMethodEmptyErrorResponseBodyError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "internal_error":
 			var res *goa.ServiceError
 			errors.As(v, &res)
@@ -346,7 +386,7 @@ func EncodeMethodEmptyErrorResponseBodyError(encoder func(context.Context, http.
 				faults := strconv.FormatBool(val)
 				w.Header().Set("Goa-Attribute-Fault", faults)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return nil
 		case "not_found":
@@ -357,7 +397,7 @@ func EncodeMethodEmptyErrorResponseBodyError(encoder func(context.Context, http.
 				inHeaders := val
 				w.Header().Set("In-Header", inHeaders)
 			}
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusNotFound)
 			return nil
 		default:
@@ -373,15 +413,19 @@ var EmptyCustomErrorResponseBodyEncoderCode = `// EncodeMethodEmptyCustomErrorRe
 func EncodeMethodEmptyCustomErrorResponseBodyError(encoder func(context.Context, http.ResponseWriter) goahttp.Encoder, formatter func(ctx context.Context, err error) goahttp.Statuser) func(context.Context, http.ResponseWriter, error) error {
 	encodeError := goahttp.ErrorEncoder(encoder, formatter)
 	return func(ctx context.Context, w http.ResponseWriter, v error) error {
-		var en ErrorNamer
+		var deprecatedErrorNamer ErrorNamer
+		if errors.As(v, &deprecatedErrorNamer) {
+			v = adaptErrorNamer(deprecatedErrorNamer)
+		}
+		var en GoaErrorNamer
 		if !errors.As(v, &en) {
 			return encodeError(ctx, w, v)
 		}
-		switch en.ErrorName() {
+		switch en.GoaErrorName() {
 		case "internal_error":
 			var res *serviceemptycustomerrorresponsebody.Error
 			errors.As(v, &res)
-			w.Header().Set("goa-error", res.ErrorName())
+			w.Header().Set("goa-error", res.GoaErrorName())
 			w.WriteHeader(http.StatusInternalServerError)
 			return nil
 		default: