001    package railo.runtime.exp;
002    
003    import railo.runtime.PageContext;
004    import railo.runtime.PageSource;
005    import railo.runtime.dump.DumpData;
006    import railo.runtime.dump.DumpProperties;
007    import railo.runtime.engine.ThreadLocalPageContext;
008    import railo.runtime.err.ErrorPage;
009    import railo.runtime.type.Struct;
010    
011    /**
012     *
013     *
014     * To change the template for this generated type comment go to
015     * Window - Preferences - Java - Code Generation - Code and Comments
016     */
017    public class PageRuntimeException extends RuntimeException implements IPageException,PageExceptionBox {
018            
019            private PageException pe;
020    
021            
022            /**
023             * constructor of the class
024             * @param pe page exception to hold
025             */
026            public PageRuntimeException(PageException pe) {
027                    super(pe.getMessage());
028                    this.pe=pe;
029            }
030            
031            /**
032             * standart excption constructor
033             * @param message message of the exception
034             */
035            public PageRuntimeException(String message) {
036                    super(message);
037                    this.pe=new ApplicationException(message);
038            }
039            
040            /**
041             * standart excption constructor
042             * @param message message of the exception
043             * @param detail detailed information to the exception
044             */
045            public PageRuntimeException(String message,String detail) {
046                    super(message);
047                    this.pe=new ApplicationException(message,detail);
048            }
049    
050            /**
051             * @see railo.runtime.exp.IPageException#getDetail()
052             */
053            public String getDetail() {
054                    return pe.getDetail();
055            }
056            
057            /**
058             * @see railo.runtime.exp.IPageException#getErrorCode()
059             */
060            public String getErrorCode() {
061                    return pe.getErrorCode();
062            }
063            
064            /**
065             * @see railo.runtime.exp.IPageException#getExtendedInfo()
066             */
067            public String getExtendedInfo() {
068                    return pe.getExtendedInfo();
069            }
070            
071            /**
072             *
073             * @see railo.runtime.exp.IPageException#getCatchBlock(railo.runtime.PageContext)
074             */
075            public Struct getCatchBlock(PageContext pc) {
076                    return pe.getCatchBlock(pc);
077            }
078            
079            /**
080             * @see railo.runtime.exp.IPageException#getCatchBlock()
081             */
082            public Struct getCatchBlock() {
083                    // TLPC
084                    return pe.getCatchBlock(ThreadLocalPageContext.get());
085            }
086            
087            /**
088             * @see railo.runtime.exp.IPageException#getErrorBlock(PageContext pc,ErrorPage ep)
089             */
090            public Struct getErrorBlock(PageContext pc,ErrorPage ep) {
091                    return pe.getErrorBlock(pc,ep);
092            }
093            /**
094             * @see railo.runtime.exp.IPageException#addContext(PageSource, int, int)
095             */
096            public void addContext(PageSource template, int line, int column,StackTraceElement ste) {
097                    pe.addContext(template,line,column,ste);
098            }
099            
100            /**
101             * @see railo.runtime.dump.Dumpable#toDumpData(railo.runtime.PageContext, int)
102             */
103            public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
104                    return pe.toDumpData(pageContext, maxlevel,dp);
105            }
106    
107            /**
108             * @see railo.runtime.exp.PageExceptionBox#getPageException()
109             */
110            public PageException getPageException() {
111                    return pe;
112            }
113    
114            /**
115             * @see railo.runtime.exp.IPageException#setDetail(java.lang.String)
116             */
117            public void setDetail(String detail) {
118                             pe.setDetail(detail);
119            }
120    
121            /**
122             * @see railo.runtime.exp.IPageException#setErrorCode(java.lang.String)
123             */
124            public void setErrorCode(String errorCode) {
125                             pe.setErrorCode(errorCode);            
126            }
127    
128            /**
129             * @see railo.runtime.exp.IPageException#setExtendedInfo(java.lang.String)
130             */
131            public void setExtendedInfo(String extendedInfo) {
132                             pe.setExtendedInfo(extendedInfo);              
133            }
134            
135            /**
136             * @see railo.runtime.exp.IPageException#typeEqual(java.lang.String)
137             */
138            public boolean typeEqual(String type) {
139                    return  pe.typeEqual(type);
140            }
141            
142            /**
143             * @see railo.runtime.exp.IPageException#getTypeAsString()
144             */
145            public String getTypeAsString() {
146                    return pe.getTypeAsString();
147            }
148    
149            /**
150             * @see railo.runtime.exp.IPageException#getCustomTypeAsString()
151             */
152            public String getCustomTypeAsString() {
153                    return pe.getCustomTypeAsString();
154            }
155    
156        /* *
157         * @see railo.runtime.exp.IPageException#getLine()
158         * /
159        public String getLine() {
160            return pe.getLine();
161        }*/
162    
163        /**
164         * @see railo.runtime.exp.IPageException#getTracePointer()
165         */
166        public int getTracePointer() {
167            return pe.getTracePointer();
168        }
169    
170        /**
171         * @see railo.runtime.exp.IPageException#setTracePointer(int)
172         */
173        public void setTracePointer(int tracePointer) {
174            pe.setTracePointer(tracePointer);
175        }
176    
177        /**
178         * @see railo.runtime.exp.IPageException#getAdditional()
179         */
180        public Struct getAdditional() {
181            return pe.getAddional();
182        }
183        public Struct getAddional() {
184            return pe.getAddional();
185        }
186    
187        public String getStackTraceAsString() {
188            return pe.getStackTraceAsString();
189        }
190    }