@@ -104,7 +104,7 @@ func (s *Store) FindRepoByID(ctx context.Context, id int64) (*ent.Repo, error) {
104104 WithOwner ().
105105 Only (ctx )
106106 if ent .IsNotFound (err ) {
107- return nil , e .NewErrorWithMessage (e .ErrorCodeNotFound , "The repository is not found." , err )
107+ return nil , e .NewErrorWithMessage (e .ErrorCodeEntityNotFound , "The repository is not found." , err )
108108 } else if err != nil {
109109 return nil , e .NewError (e .ErrorCodeInternalError , err )
110110 }
@@ -128,7 +128,7 @@ func (s *Store) FindRepoOfUserByID(ctx context.Context, u *ent.User, id int64) (
128128 WithOwner ().
129129 Only (ctx )
130130 if ent .IsNotFound (err ) {
131- return nil , e .NewErrorWithMessage (e .ErrorCodeNotFound , "The repository is not found." , err )
131+ return nil , e .NewErrorWithMessage (e .ErrorCodeEntityNotFound , "The repository is not found." , err )
132132 } else if err != nil {
133133 return nil , e .NewError (e .ErrorCodeInternalError , err )
134134 }
@@ -155,7 +155,7 @@ func (s *Store) FindRepoOfUserByNamespaceName(ctx context.Context, u *ent.User,
155155 WithOwner ().
156156 Only (ctx )
157157 if ent .IsNotFound (err ) {
158- return nil , e .NewErrorWithMessage (e .ErrorCodeNotFound , "The repository is not found." , err )
158+ return nil , e .NewErrorWithMessage (e .ErrorCodeEntityNotFound , "The repository is not found." , err )
159159 } else if err != nil {
160160 return nil , e .NewError (e .ErrorCodeInternalError , err )
161161 }
@@ -173,7 +173,7 @@ func (s *Store) SyncRepo(ctx context.Context, r *vo.RemoteRepo) (*ent.Repo, erro
173173 Save (ctx )
174174 if ent .IsValidationError (err ) {
175175 return nil , e .NewErrorWithMessage (
176- e .ErrorCodeUnprocessableEntity ,
176+ e .ErrorCodeEntityUnprocessable ,
177177 fmt .Sprintf ("The value of \" %s\" field is invalid." , err .(* ent.ValidationError ).Name ),
178178 err )
179179 } else if err != nil {
@@ -190,7 +190,7 @@ func (s *Store) UpdateRepo(ctx context.Context, r *ent.Repo) (*ent.Repo, error)
190190 Save (ctx )
191191 if ent .IsValidationError (err ) {
192192 return nil , e .NewErrorWithMessage (
193- e .ErrorCodeUnprocessableEntity ,
193+ e .ErrorCodeEntityUnprocessable ,
194194 fmt .Sprintf ("The value of \" %s\" field is invalid." , err .(* ent.ValidationError ).Name ),
195195 err )
196196 } else if err != nil {
@@ -209,7 +209,7 @@ func (s *Store) Activate(ctx context.Context, r *ent.Repo) (*ent.Repo, error) {
209209 Save (ctx )
210210 if ent .IsValidationError (err ) {
211211 return nil , e .NewErrorWithMessage (
212- e .ErrorCodeUnprocessableEntity ,
212+ e .ErrorCodeEntityUnprocessable ,
213213 fmt .Sprintf ("The value of \" %s\" field is invalid." , err .(* ent.ValidationError ).Name ),
214214 err )
215215 } else if err != nil {
@@ -228,7 +228,7 @@ func (s *Store) Deactivate(ctx context.Context, r *ent.Repo) (*ent.Repo, error)
228228 Save (ctx )
229229 if ent .IsValidationError (err ) {
230230 return nil , e .NewErrorWithMessage (
231- e .ErrorCodeUnprocessableEntity ,
231+ e .ErrorCodeEntityUnprocessable ,
232232 fmt .Sprintf ("The value of \" %s\" field is invalid." , err .(* ent.ValidationError ).Name ),
233233 err )
234234 } else if err != nil {
0 commit comments