View Javadoc

1   package com.tapina.robe.swi;
2   
3   import com.tapina.robe.runtime.Environment;
4   
5   /***
6    * Created by IntelliJ IDEA.
7    * User: gareth
8    * Date: Aug 22, 2003
9    * Time: 6:17:59 PM
10   */
11  public final class SWIError extends RuntimeException {
12      private final int errorNumber;
13      private final int errorBlock;
14  
15      public SWIError(int errorNumber, String string) {
16          super(string);
17          this.errorNumber = errorNumber;
18          this.errorBlock = 0;
19      }
20  
21      public SWIError(int errorNumber, Throwable throwable) {
22          super(throwable);
23          this.errorNumber = errorNumber;
24          this.errorBlock = 0;
25      }
26  
27      public SWIError(Environment env, int errorBlock) {
28          super(env.getMemoryMap().getString0(errorBlock + 4));
29          this.errorNumber = env.getMemoryMap().getWord(errorBlock);
30          this.errorBlock = env.getCpu().R[0];
31      }
32  
33      public final int getErrorNumber() {
34          return errorNumber;
35      }
36  
37      public int getErrorBlock() {
38          return errorBlock;
39      }
40  }