File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed
src/com/magento/idea/magento2plugin/project/diagnostic/github Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -51,13 +51,22 @@ public static String buildNewBugReportBody(
5151 if (encode (stackTrace ).length () <= maxAllowedStackTraceLength ) {
5252 return buildTemplate (project , bugDescription , stackTrace );
5353 }
54+ boolean isFound = false ;
55+ int step = 1 ;
56+ String encodedCutStackTrace = "" ;
57+
58+ while (!isFound ) {
59+ final String cutStackTrace = stackTrace .substring (0 , maxAllowedStackTraceLength - step );
60+ encodedCutStackTrace = encode (cutStackTrace );
61+
62+ if (encodedCutStackTrace .length () <= maxAllowedStackTraceLength ) {
63+ isFound = true ;
64+ } else {
65+ step += 10 ;
66+ }
67+ }
5468
55- final String cutStackTrace = encode (stackTrace ).substring (
56- 0 ,
57- maxAllowedStackTraceLength - 1
58- );
59-
60- return buildTemplate (project , bugDescription , decode (cutStackTrace ));
69+ return buildTemplate (project , bugDescription , decode (encodedCutStackTrace ));
6170 }
6271
6372 /**
You can’t perform that action at this time.
0 commit comments