File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
src/main/scala/gitbucket/monitoring/controllers Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 11package gitbucket .monitoring .controllers
22
3+ import scala .util .Try
34import gitbucket .monitoring .services .{LogBack , GitBucketLog }
45import gitbucket .monitoring .information .logs ._
56
@@ -16,19 +17,15 @@ trait LogController extends MonitoringControllerBase {
1617 val defaultSettings = GitBucketLog .getDefaultSettings
1718 val lineNum = request.getParameter(" lines" )
1819
19- if (Option (lineNum) != None ){
20- try {
21- val n = lineNum.toInt
22- if (n > defaultSettings.displayLimitLines) {
23- html.gitbucketlog(defaultSettings, os.getLog(defaultSettings.displayLimitLines));
24- } else {
25- html.gitbucketlog(defaultSettings, os.getLog(n));
26- }
27- } catch {
28- case e : Exception => html.gitbucketlog(defaultSettings, os.getLog());
20+ if (Try (lineNum.toInt).toOption != None ){
21+ val n = lineNum.toInt
22+ if (n > defaultSettings.displayLimitLines) {
23+ html.gitbucketlog(defaultSettings, os.getLog(defaultSettings.displayLimitLines));
24+ } else {
25+ html.gitbucketlog(defaultSettings, os.getLog(n));
2926 }
3027 } else {
31- html.gitbucketlog(defaultSettings, os.getLog());
28+ html.gitbucketlog(defaultSettings, os.getLog(defaultSettings.defaultDisplayLines ));
3229 }
3330 })
3431}
You can’t perform that action at this time.
0 commit comments