/plugins/AntFarm/tags/antfarm-1-5/plugin/integration/jEditException.java

# · Java · 96 lines · 32 code · 15 blank · 49 comment · 2 complexity · 15a628a5307093ff27db3200c76a1960 MD5 · raw file

  1. /*
  2. * jEditException.java - Plugin for running Ant builds from jEdit.
  3. * Copyright (C) 2001 Brian Knowles
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18. */
  19. package plugin.integration;
  20. import java.io.*;
  21. /**
  22. * An exception for jEdit errors.
  23. *
  24. * @author steinbeck
  25. * @created 27. August 2001
  26. */
  27. public class jEditException
  28. extends Exception
  29. {
  30. private Throwable nestedException;
  31. /**
  32. * Create a new <code>jEditException</code>.
  33. *
  34. * @param msg Description of Parameter
  35. */
  36. public jEditException( String msg )
  37. {
  38. super( msg );
  39. }
  40. /**
  41. * Create a new <code>jEditException</code>.
  42. *
  43. * @param msg Description of Parameter
  44. * @param t Description of Parameter
  45. */
  46. public jEditException( String msg, Throwable t )
  47. {
  48. super( msg );
  49. nestedException = t;
  50. }
  51. /**
  52. * Prints this stack trace to standard error.
  53. */
  54. public void printStackTrace()
  55. {
  56. printStackTrace( System.err );
  57. }
  58. /**
  59. * Prints the stack trace to the given <code>PrintWriter</code>.
  60. *
  61. * @param writer Description of Parameter
  62. */
  63. public void printStackTrace( PrintWriter writer )
  64. {
  65. super.printStackTrace( writer );
  66. if ( null != nestedException ) {
  67. writer.println( "Nested Exception:" );
  68. nestedException.printStackTrace( writer );
  69. }
  70. }
  71. /**
  72. * Prints this <code>Throwable</code> and its backtrace to a given <code>PrintStream</code>
  73. * .
  74. *
  75. * @param stream Description of Parameter
  76. */
  77. public void printStackTrace( PrintStream stream )
  78. {
  79. printStackTrace( new PrintWriter( stream, true ) );
  80. }
  81. }