dmolony-DiskBrowser/src/com/bytezone/diskbrowser/applefile/ErrorMessageFile.java
2020-09-14 17:59:15 +10:00

34 lines
1.1 KiB
Java

package com.bytezone.diskbrowser.applefile;
// -----------------------------------------------------------------------------------//
public class ErrorMessageFile extends AbstractFile
// -----------------------------------------------------------------------------------//
{
String text;
// ---------------------------------------------------------------------------------//
public ErrorMessageFile (String name, byte[] buffer, Exception e)
// ---------------------------------------------------------------------------------//
{
super (name, buffer);
StringBuilder text = new StringBuilder ();
text.append ("Oops! : " + e.toString () + "\n\n");
for (StackTraceElement ste : e.getStackTrace ())
text.append (ste + "\n");
if (text.length () > 0)
text.deleteCharAt (text.length () - 1);
this.text = text.toString ();
}
// ---------------------------------------------------------------------------------//
@Override
public String getText ()
// ---------------------------------------------------------------------------------//
{
return text;
}
}