Skip to content

Commit dd0b3ca

Browse files
authored
Merge pull request #3201 from onflow/supun/fix-errors
Simplify AuthorizationMismatchError
2 parents b50643f + 207e367 commit dd0b3ca

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

runtime/stdlib/cadence_v0.42_to_v1_contract_upgrade_validator.go

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -684,24 +684,19 @@ type AuthorizationMismatchError struct {
684684
}
685685

686686
var _ errors.UserError = &AuthorizationMismatchError{}
687-
var _ errors.SecondaryError = &AuthorizationMismatchError{}
688687

689688
func (*AuthorizationMismatchError) IsUserError() {}
690689

691690
func (e *AuthorizationMismatchError) Error() string {
692-
return "mismatching authorization"
693-
}
694-
695-
func (e *AuthorizationMismatchError) SecondaryError() string {
696691
if e.ExpectedAuthorization == sema.PrimitiveAccess(ast.AccessAll) {
697692
return fmt.Sprintf(
698-
"The entitlements migration would not grant this value any entitlements, but the annotation present is `%s`",
693+
"mismatching authorization: the entitlements migration would not grant this value any entitlements, but the annotation present is `%s`",
699694
e.FoundAuthorization.QualifiedString(),
700695
)
701696
}
702697

703698
return fmt.Sprintf(
704-
"The entitlements migration would only grant this value `%s`, but the annotation present is `%s`",
699+
"mismatching authorization: the entitlements migration would only grant this value `%s`, but the annotation present is `%s`",
705700
e.ExpectedAuthorization.QualifiedString(),
706701
e.FoundAuthorization.QualifiedString(),
707702
)

0 commit comments

Comments
 (0)