* [ 1671816 ] MIssue.create fail for long stack trace

This commit is contained in:
Heng Sin Low 2007-03-01 16:31:52 +00:00
parent fef4fb5a2e
commit aa4466a849
1 changed files with 14 additions and 2 deletions

View File

@ -49,6 +49,12 @@ public class MIssue extends X_AD_Issue
// //
MIssue issue = new MIssue(record); MIssue issue = new MIssue(record);
String error = issue.report(); String error = issue.report();
String errorTrace = issue.getErrorTrace();
if (errorTrace != null && errorTrace.length() >= 1900)
issue.setErrorTrace(errorTrace.substring(0, 1900));
String stackTrace = issue.getStackTrace();
if (stackTrace != null && stackTrace.length() >= 1900)
issue.setStackTrace(stackTrace.substring(0, 1900));
issue.save(); issue.save();
if (error != null) if (error != null)
return null; return null;
@ -246,8 +252,11 @@ public class MIssue extends X_AD_Issue
return; return;
StackTrace = StackTrace.replace("java.lang.", ""); StackTrace = StackTrace.replace("java.lang.", "");
StackTrace = StackTrace.replace("java.sql.", ""); StackTrace = StackTrace.replace("java.sql.", "");
//[ 1671816 ] MIssue.create fail for long stack trace
//somehow INFOLENGTH-1 doesn't work for postgresql
if (StackTrace.length() > INFOLENGTH) if (StackTrace.length() > INFOLENGTH)
StackTrace = StackTrace.substring(0,INFOLENGTH-1); StackTrace = StackTrace.substring(0,INFOLENGTH-2);
super.setStackTrace (StackTrace); super.setStackTrace (StackTrace);
} // setStackTrace } // setStackTrace
@ -263,8 +272,11 @@ public class MIssue extends X_AD_Issue
return; return;
ErrorTrace = ErrorTrace.replace("java.lang.", ""); ErrorTrace = ErrorTrace.replace("java.lang.", "");
ErrorTrace = ErrorTrace.replace("java.sql.", ""); ErrorTrace = ErrorTrace.replace("java.sql.", "");
//[ 1671816 ] MIssue.create fail for long stack trace
//somehow INFOLENGTH-1 doesn't work for postgresql
if (ErrorTrace.length() > INFOLENGTH) if (ErrorTrace.length() > INFOLENGTH)
ErrorTrace = ErrorTrace.substring(0,INFOLENGTH-1); ErrorTrace = ErrorTrace.substring(0,INFOLENGTH-2);
super.setErrorTrace (ErrorTrace); super.setErrorTrace (ErrorTrace);
} // setErrorTrace } // setErrorTrace