Modify ↓
Opened 17 years ago
Closed 17 years ago
#5928 closed defect (invalid)
replacing null or non-informative error messages
Reported by: | Owned by: | Martin | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description (last modified by )
/jsutil/fileUtil.js Original code with no information which causes the error fileUtil.readFile = function(/*String*/path, /*String?*/encoding){ //summary: reads a file and returns a string encoding = encoding || "utf-8"; var file = new java.io.File(path); var lineSeparator = fileUtil.getLineSeparator(); java.lang.System.out.println("path="+path); var input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)); try { var stringBuffer = new java.lang.StringBuffer(); var line = ""; while((line = input.readLine()) !== null){ stringBuffer.append(line); stringBuffer.append(lineSeparator); } //Make sure we return a JavaScript string and not a Java string. return new String(stringBuffer.toString()); //String } finally { input.close(); } } /*******change which contains information on what file is being referenced *******/ fileUtil.readFile = function(/*String*/path, /*String?*/encoding){ //summary: reads a file and returns a string encoding = encoding || "utf-8"; var file = new java.io.File(path); var lineSeparator = fileUtil.getLineSeparator(); java.lang.System.out.println("path="+path); var input = new java.io.BufferedReader(new java.io.InputStreamReader(new java.io.FileInputStream(file), encoding)); try { var stringBuffer = new java.lang.StringBuffer(); var line = ""; while((line = input.readLine()) !== null){ stringBuffer.append(line); stringBuffer.append(lineSeparator); } //Make sure we return a JavaScript string and not a Java string. return new String(stringBuffer.toString()); //String } catch(excp) { System.out.println("Exception caught message ="+excp.getMessage()); input.close(); } }
..in a normal sense if the developer downloads everything they should never see this. but in case one file is missing the JS function aborts out saying file is missing but no indication on what file is missing
26 Aug 2007 MG
Attachments (0)
Change History (1)
comment:1 by , 17 years ago
Description: | modified (diff) |
---|---|
Resolution: | → invalid |
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
I think you reported this issue to the wrong Trac. This is the bugtracker for Trac itself, and you likely want to report this in some project's specific Trac instance. We don't use Java here.