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

type the No valid trust data error #1212

Merged
merged 1 commit into from
Aug 17, 2017
Merged

type the No valid trust data error #1212

merged 1 commit into from
Aug 17, 2017

Conversation

eiais
Copy link
Contributor

@eiais eiais commented Aug 14, 2017

Signed-off-by: Kyle Spiers kyle@spiers.me

client/client.go Outdated
@@ -595,6 +595,12 @@ type TargetSignedStruct struct {
Signatures []data.Signature
}

type NoValidTrustDataError string
Copy link
Contributor

@cyli cyli Aug 14, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to name this something more like NoSuchTarget? Because there is already a ErrRepositoryNotExist which returns text similar to "... does not have trust data for ...", and the error type name would be clearer I think. Similarly, would be nice if we could say something like "No valid trust data for target %s" instead.

@cyli
Copy link
Contributor

cyli commented Aug 14, 2017

Can we also return the same error in GetTargetByName? The error text is currently slightly different, but that function and GetAllTargetMetadataByName should probably return the same error type for the same failure.

client/client.go Outdated
@@ -595,6 +595,12 @@ type TargetSignedStruct struct {
Signatures []data.Signature
}

type ErrNoSuchTarget string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a lint error because this error doesn't have a comment. (You can verify with make lint).

Copy link
Contributor

@cyli cyli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than the linting issue, this LGTM on green.

Copy link
Contributor

@ashfall ashfall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM on green

Signed-off-by: Kyle Spiers <kyle@spiers.me>
@cyli cyli merged commit e8ee47e into notaryproject:master Aug 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants