View Javadoc

1   package fr.ove.openmath.exceptions;
2   
3   import fr.ove.openmath.exceptions.*;
4   
5   /***
6   * Specific Control exception to specialize treatment of errors according
7   * to the symbol that thrown it.
8   *
9   * @author © 1999 DIRAT Laurent
10  * @version 1.0  28/05/99
11  */
12  public class ControlException extends ErrorMessageException {
13      /***
14      * The constructor.
15      * @param symbol The symbol which thrown the instance.
16      */
17      public ControlException(String symbol) {
18          this(symbol, null);
19      }
20  
21      /***
22      * The constructor.
23      * @param symbol the symbol which thrown the instance.
24      * @param details the details of the exception
25      */
26      public ControlException(String symbol, Object details) {
27          super(symbol, details);
28  
29          if (symbol.equals("unhandledSymbol"))
30              setErrorMessage("Symbol Unhandled by the Application");
31          else if (symbol.equals("unknownSymbol"))
32              setErrorMessage("The Symbol does not Exist in the Specified CD");
33          else if (symbol.equals("unknownCD"))
34              setErrorMessage("The Specified CD is not Handled by the Application");
35          else if (symbol.equals("algorithm"))
36              setErrorMessage("Operation not or Partially Implemented");
37          else if (symbol.equals("limitation"))
38              setErrorMessage("Implementation Limitation");
39          else if (symbol.equals("unexpected"))
40              setErrorMessage("Unexpected Problem");
41          else if (symbol.equals("system"))
42              setErrorMessage("System Error");
43          else if (symbol.equals("terminated"))
44              setErrorMessage("Communication Terminted. Server Shutted Down");
45          else if (symbol.equals("commandOk"))
46              setErrorMessage("Command Successfully Executed");
47          else if (symbol.equals("encodingError"))
48              setErrorMessage("Lexical and/or Syntactic Error Detected");
49          else if (symbol.equals("semanticError"))
50              setErrorMessage("Semantic Error Detected");
51      }
52  }