-
Notifications
You must be signed in to change notification settings - Fork 77
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
standardize errors and logs of server pkg #218
Conversation
7c1c48f
to
60e1a88
Compare
pkg/server/app/app.go
Outdated
if ops.kops.IsAlreadyExists(err) { | ||
return ErrAlreadyExists | ||
} | ||
return teresa_errors.New(teresa_errors.ErrInternalServerError, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I would go with teresa_errors.NewInternalServerError(err)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree. This little change will simplify a lot.
pkg/server/app/app.go
Outdated
@@ -201,9 +212,9 @@ func (ops *AppOperations) TeamName(appName string) (string, error) { | |||
teamName, err := ops.kops.NamespaceLabel(appName, TeresaTeamLabel) | |||
if err != nil { | |||
if ops.kops.IsNotFound(err) { | |||
return "", newAppErr(ErrNotFound, err) | |||
return "", teresa_errors.New(ErrNotFound, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe just return "", ErrNotFound
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, your right!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔁
This change is