]> gerrit.simantics Code Review - simantics/r.git/blob - org.simantics.r.scl/src/org/rosuda/REngine/REngineEvalException.java
(refs #6833) Test RExp inheritance in SCL
[simantics/r.git] / org.simantics.r.scl / src / org / rosuda / REngine / REngineEvalException.java
1 package org.rosuda.REngine ;
2
3 /**
4  * Exception thrown when an error occurs during eval. 
5  * 
6  * <p>
7  * This class is a placeholder and should be extended when more information
8  * can be extracted from R (call stack, etc ... )
9  * </p>
10  */
11 public class REngineEvalException extends REngineException {
12         
13         /**
14          * Value returned by the rniEval native method when the input passed to eval
15          * is invalid
16          */ 
17         public static final int INVALID_INPUT = -1 ;
18         
19         /**
20          * Value returned by the rniEval native method when an error occured during 
21          * eval (stop, ...)
22          */
23         public static final int ERROR = -2 ;  
24
25         /**
26          * Type of eval error
27          */
28         protected int type ; 
29         
30         /**
31          * Constructor
32          *
33          * @param eng associated REngine
34          * @param message error message
35          * @param type type of error (ERROR or INVALID_INPUT)
36          */
37         public REngineEvalException( REngine eng, String message, int type ){
38                 super( eng, message );
39                 this.type = type ;
40         }
41         
42         /**
43          * Constructor using ERROR type
44          *
45          * @param eng associated REngine
46          * @param message error message
47          */
48         public REngineEvalException( REngine eng, String message){
49                 this( eng, message, ERROR );
50         }
51         
52         /**
53          * @return the type of error (ERROR or INVALID_INPUT)
54          */
55         public int getType(){
56                 return type ;
57         }
58         
59 }