@@ -181,28 +181,27 @@ func setMergeTarget(ctx *context.Context, pull *issues_model.PullRequest) {
181181
182182// GetPullDiffStats get Pull Requests diff stats
183183func GetPullDiffStats (ctx * context.Context ) {
184+ // FIXME: this getPullInfo seems to be a duplicate call with other route handlers
184185 issue , ok := getPullInfo (ctx )
185186 if ! ok {
186187 return
187188 }
188189 pull := issue .PullRequest
189190
190191 mergeBaseCommitID := GetMergedBaseCommitID (ctx , issue )
191-
192192 if mergeBaseCommitID == "" {
193- ctx .NotFound (nil )
194- return
193+ return // no merge base, do nothing, do not stop the route handler, see below
195194 }
196195
196+ // do not report 500 server error to end users if error occurs, otherwise a PR missing ref won't be able to view.
197197 headCommitID , err := ctx .Repo .GitRepo .GetRefCommitID (pull .GetGitRefName ())
198198 if err != nil {
199- ctx . ServerError ( " GetRefCommitID" , err )
199+ log . Error ( "Failed to GetRefCommitID: %v, repo: %v " , err , ctx . Repo . Repository . FullName () )
200200 return
201201 }
202-
203202 diffShortStat , err := gitdiff .GetDiffShortStat (ctx .Repo .GitRepo , mergeBaseCommitID , headCommitID )
204203 if err != nil {
205- ctx . ServerError ( " GetDiffShortStat" , err )
204+ log . Error ( "Failed to GetDiffShortStat: %v, repo: %v " , err , ctx . Repo . Repository . FullName () )
206205 return
207206 }
208207
0 commit comments