Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: com/tuneology/avm/ProcessException.java


1   /*
2     ProcessException.java
3   
4     Copyright (C) 2002 Fran Taylor
5   
6     This file is part of java-avm.
7   
8     java-avm is free software; you can redistribute it and/or modify it
9     under the terms of the GNU Lesser General Public License as
10    published by the Free Software Foundation; either version 2 of the
11    License, or (at your option) any later version.
12  
13    java-avm is distributed in the hope that it will be useful, but
14    WITHOUT ANY WARRANTY; without even the implied warranty of
15    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16    Lesser General Public License for more details.
17  
18    You should have received a copy of the GNU Lesser General Public
19    License along with java-avm; if not, write to the Free Software
20    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
21    USA
22  
23    $Id: ProcessException.java,v 1.1 2002/09/23 05:03:11 xnarf Exp $
24  
25  */
26  
27  package com.tuneology.avm;
28  
29  import java.io.*;
30  
31  /**
32   * An exception for handling errors from external programs.
33   * The error output contains raw SCSI info and so forth,
34   * and as such it needs some skill to parse correctly
35   * so we try to pick out a nice error message.
36   * The entire original output is available 
37   * via getExtendedError().
38   *
39   * @version $Id: ProcessException.java,v 1.1 2002/09/23 05:03:11 xnarf Exp $
40   * 
41   * @author Fran Taylor
42   */
43  
44  public class ProcessException extends IOException {
45      /**
46       *
47       * @param err
48       */
49      public ProcessException(String err) {
50    super(extractErrorMessage(err));
51    extendedError = err;
52      }
53      /**
54       *
55       * @param errMsg
56       * @param err
57       */
58      public ProcessException(String errMsg, String err) {
59    super(errMsg);
60    extendedError = err;
61      }
62      /**
63       *
64       * @return extended error message.
65       */
66      public String getExtendedError() { return extendedError; }
67  
68      /**
69       * Figure out a nice error message 
70       * from all those SCSI errors and so forth.
71       */
72      private static String extractErrorMessage(String err) {
73    return err;
74      }
75      
76      private String extendedError;
77  }
78  
79  /*
80     Local Variables:
81     mode:java
82     indent-tabs-mode:nil 
83     c-basic-offset:4 
84     c-indent-level:4 
85     c-continued-statement-offset:4 
86     c-brace-offset:-4 
87     c-brace-imaginary-offset:-4 
88     c-argdecl-indent:0
89     c-label-offset:0
90     End:
91  */