001/** 002 * 003 * Copyright (c) 2014, the Railo Company Ltd. All rights reserved. 004 * 005 * This library is free software; you can redistribute it and/or 006 * modify it under the terms of the GNU Lesser General Public 007 * License as published by the Free Software Foundation; either 008 * version 2.1 of the License, or (at your option) any later version. 009 * 010 * This library is distributed in the hope that it will be useful, 011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 013 * Lesser General Public License for more details. 014 * 015 * You should have received a copy of the GNU Lesser General Public 016 * License along with this library. If not, see <http://www.gnu.org/licenses/>. 017 * 018 **/ 019package lucee.runtime.exp; 020 021 022import lucee.runtime.PageContext; 023import lucee.runtime.PageSource; 024import lucee.runtime.config.Config; 025import lucee.runtime.dump.Dumpable; 026import lucee.runtime.err.ErrorPage; 027import lucee.runtime.type.Struct; 028 029/** 030 * interface of the root business exception of lucee 031 */ 032public interface IPageException extends Dumpable { 033 034 /** 035 * return detailed error message 036 * @return detailed error message 037 */ 038 public String getDetail(); 039 040 /** 041 * Error Code 042 * @return Error Code 043 */ 044 public String getErrorCode(); 045 046 /** 047 * return extended info to the error 048 * @return extended info 049 */ 050 public String getExtendedInfo(); 051 052 /* * 053 * @return returns the line where the failure occured 054 */ 055 //public String getLine(); 056 057 /** 058 * @return Returns the tracePointer. 059 */ 060 public int getTracePointer(); 061 062 /** 063 * @param tracePointer The tracePointer to set. 064 */ 065 public void setTracePointer(int tracePointer); 066 067 /** 068 * Error type as String 069 * @return error type 070 */ 071 public String getTypeAsString(); 072 073 /** 074 * Error custom type as String 075 * @return error type 076 */ 077 public String getCustomTypeAsString(); 078 079 /** 080 * return detailed catch block of the error 081 * @return catch block 082 * @deprecated use instead <code>getCatchBlock(Config config);</code> 083 */ 084 public Struct getCatchBlock(PageContext pc); 085 086 /** 087 * return detailed catch block of the error 088 * @return catch block 089 */ 090 public CatchBlock getCatchBlock(Config config); 091 092 /** 093 * return detailed error block of the error 094 * @param pc page context of the request 095 * @param ep error page 096 * @return catch block 097 */ 098 public Struct getErrorBlock(PageContext pc, ErrorPage ep); 099 100 /** 101 * add a template to the context of the error 102 * @param pageSource new template context 103 * @param line line of the error 104 * @param column column of the error 105 */ 106 public void addContext(PageSource pageSource, int line, int column, StackTraceElement element); 107 108 /** 109 * compare error type as String 110 * @param type other error type 111 * @return is same error type 112 */ 113 public boolean typeEqual(String type); 114 115 /** 116 * sets detailed error message 117 * @param detail 118 */ 119 public void setDetail(String detail); 120 121 /** 122 * sets the Error Code 123 * @param errorCode 124 */ 125 public void setErrorCode(String errorCode); 126 127 /** 128 * sets extended info to the error 129 * @param extendedInfo 130 */ 131 public void setExtendedInfo(String extendedInfo); 132 133 /** 134 * @return Returns the additional. 135 * @deprecated use instead <code>getAdditional();</code> 136 */ 137 public Struct getAddional(); 138 139 /** 140 * @return Returns the additional. 141 */ 142 public Struct getAdditional(); 143 144 /** 145 * returns the java stracktrace as a String 146 * @return stack trace 147 */ 148 public String getStackTraceAsString(); 149}