# Error variable structure

**URL:** <https://dev.lucee.org/t/error-variable-structure/1673>\
**Category:** google-group-archive\
**Created:** [November 27, 2016, 7:25pm UTC](https://dev.lucee.org/t/error-variable-structure/1673 "2016-11-27T19:25:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pierre\_Larde](https://dev.lucee.org/user_avatar/dev.lucee.org/pierre_larde/32/852_2.png) [@Pierre\_Larde](https://dev.lucee.org/u/Pierre_Larde)\
**Post date:** [November 27, 2016, 7:25pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/1 "2016-11-27T19:25:25Z")

</div>

In Coldfusion, I was using the error structure to get error informations,  
like : #error.template# , #error.rootCause# , #error.diagnostics# , etc …

with Lucee 4.5 , these variables give an error

In what variable to get error informations ?

Thanks for help

---

<div class="post-metadata">

**Author:** ![Igal](https://dev.lucee.org/user_avatar/dev.lucee.org/igal/32/269_2.png) [@Igal](https://dev.lucee.org/u/Igal)\
**Post date:** [November 27, 2016, 9:00pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/2 "2016-11-27T21:00:25Z")

</div>

Why not do something like:

```
 <cfdump var="#error#">

```

or

```
 dump(error)

```

and find out all of the information available in the error struct?

alternatively, StructKeyList(error) and StructKeyArray(error) should  
give you the keys only.

Igal Sapir  
Lucee Core Developer  
[Lucee.org](http://Lucee.org) [http://lucee.org/](http://lucee.org/)On 11/27/2016 11:25 AM, Pierre Larde wrote:

> In Coldfusion, I was using the error structure to get error informations,  
> like : #error.template# , #error.rootCause# , #error.diagnostics# ,  
> etc …
> 
> with Lucee 4.5 , these variables give an error
> 
> In what variable to get error informations ?
> 
> Thanks for help
> 
> ## – Get 10% off of the regular price for this years CFCamp in Munich, Germany (Oct. 20th & 21st) with the Lucee discount code Lucee@cfcamp. 189€ instead of 210€. Visit [CFCamp 2016](https://ti.to/cfcamp/cfcamp-2016/discount/Lucee@cfcamp)
> 
> You received this message because you are subscribed to the Google  
> Groups “Lucee” group.  
> To unsubscribe from this group and stop receiving emails from it, send  
> an email to [lucee+unsubscribe@googlegroups.com](mailto:lucee+unsubscribe@googlegroups.com)  
> [mailto:lucee+unsubscribe@googlegroups.com](mailto:lucee+unsubscribe@googlegroups.com).  
> To post to this group, send email to [lucee@googlegroups.com](mailto:lucee@googlegroups.com)  
> [mailto:lucee@googlegroups.com](mailto:lucee@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/lucee/061102ef-99fd-4f69-936f-9269fe70369c%40googlegroups.com](https://groups.google.com/d/msgid/lucee/061102ef-99fd-4f69-936f-9269fe70369c%40googlegroups.com)  
> [https://groups.google.com/d/msgid/lucee/061102ef-99fd-4f69-936f-9269fe70369c%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/lucee/061102ef-99fd-4f69-936f-9269fe70369c%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Pierre\_Larde](https://dev.lucee.org/user_avatar/dev.lucee.org/pierre_larde/32/852_2.png) [@Pierre\_Larde](https://dev.lucee.org/u/Pierre_Larde)\
**Post date:** [November 28, 2016, 1:26pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/3 "2016-11-28T13:26:48Z")

</div>

I do not understand well,  
Do you have a full code example ?

I use the old fashion application.cfm  
But I think there is no difference.  
What code line to put in the application.cfm

Today I have :

and in site\_error.cfm  
I was using the error structure variables. (via a mail to support)

Could you give me a full replacement of this code (from Coldfusion, working  
fine)

Thanks a lot.  
Pierre.Le dimanche 27 novembre 2016 20:25:25 UTC+1, Pierre Larde a écrit :

> In Coldfusion, I was using the error structure to get error informations,  
> like : #error.template# , #error.rootCause# , #error.diagnostics# , etc  
> …
> 
> with Lucee 4.5 , these variables give an error
> 
> In what variable to get error informations ?
> 
> Thanks for help

---

<div class="post-metadata">

**Author:** ![Pierre\_Larde](https://dev.lucee.org/user_avatar/dev.lucee.org/pierre_larde/32/852_2.png) [@Pierre\_Larde](https://dev.lucee.org/u/Pierre_Larde)\
**Post date:** [November 28, 2016, 4:07pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/4 "2016-11-28T16:07:46Z")

</div>

OK, yes, it does all work again.  
I am confused.

Thanks.Le dimanche 27 novembre 2016 20:25:25 UTC+1, Pierre Larde a écrit :

> In Coldfusion, I was using the error structure to get error informations,  
> like : #error.template# , #error.rootCause# , #error.diagnostics# , etc  
> …
> 
> with Lucee 4.5 , these variables give an error
> 
> In what variable to get error informations ?
> 
> Thanks for help

---

<div class="post-metadata">

**Author:** ![Pierre\_Larde](https://dev.lucee.org/user_avatar/dev.lucee.org/pierre_larde/32/852_2.png) [@Pierre\_Larde](https://dev.lucee.org/u/Pierre_Larde)\
**Post date:** [November 28, 2016, 11:05am UTC](https://dev.lucee.org/t/error-variable-structure/1673/5 "2016-11-28T11:05:38Z")

</div>

I tried cfdump of error  
And, message is : variable “error” doest not exists.

So, what is the way to get error informations ?

I used this Under coldfusion to get error information.  
Thanks,  
Pierre.Le dimanche 27 novembre 2016 20:25:25 UTC+1, Pierre Larde a écrit :

> In Coldfusion, I was using the error structure to get error informations,  
> like : #error.template# , #error.rootCause# , #error.diagnostics# , etc  
> …
> 
> with Lucee 4.5 , these variables give an error
> 
> In what variable to get error informations ?
> 
> Thanks for help

---

<div class="post-metadata">

**Author:** ![Daniel\_Huang](https://dev.lucee.org/user_avatar/dev.lucee.org/daniel_huang/32/3762_2.png) [@Daniel\_Huang](https://dev.lucee.org/u/Daniel_Huang)\
**Post date:** [November 2, 2021, 7:41am UTC](https://dev.lucee.org/t/error-variable-structure/1673/6 "2021-11-02T07:41:47Z")

</div>

I got the same problem, tried “”, got variable [ERROR] doesn’t exist. Any solution for this?

---

<div class="post-metadata">

**Author:** ![cfmitrah](https://dev.lucee.org/user_avatar/dev.lucee.org/cfmitrah/32/140_2.png) [@cfmitrah](https://dev.lucee.org/u/cfmitrah)\
**Post date:** [November 2, 2021, 8:12am UTC](https://dev.lucee.org/t/error-variable-structure/1673/7 "2021-11-02T08:12:33Z")

</div>

@Daniel_Huang Related issue from Jira [LDEV-3739](https://luceeserver.atlassian.net/browse/LDEV-3739).  
Use the `cfcatch` instead of the `error` variable. Hope it will solve your issue.

---

<div class="post-metadata">

**Author:** ![Daniel\_Huang](https://dev.lucee.org/user_avatar/dev.lucee.org/daniel_huang/32/3762_2.png) [@Daniel\_Huang](https://dev.lucee.org/u/Daniel_Huang)\
**Post date:** [November 2, 2021, 8:54am UTC](https://dev.lucee.org/t/error-variable-structure/1673/8 "2021-11-02T08:54:45Z")

</div>

@cfmitrah Thanks for your quick response, it seems the structure of cfcatch has some difference to ACF’s error variable, can we get the info from cfcatch or other variable for below fields  
RemoteAddress  
RootCause  
HTTPReferer  
QueryString  
Diagnostics  
Template

Reference from ColdFusion  
[https://helpx.adobe.com/coldfusion/cfml-reference/reserved-words-and-variables/coldfusion-tag-specific-variables/cferror-variables.html](https://helpx.adobe.com/coldfusion/cfml-reference/reserved-words-and-variables/coldfusion-tag-specific-variables/cferror-variables.html)

When cferror generates an error page, the following error variables are available if type=“request” or “exception”.

Error.Diagnostics  
Error.MailTo  
Error.DateTime  
Error.Browser  
Error.GeneratedContent  
Error.RemoteAddress  
Error.HTTPReferer  
Error.Template  
Error.QueryString

---

<div class="post-metadata">

**Author:** ![Daniel\_Huang](https://dev.lucee.org/user_avatar/dev.lucee.org/daniel_huang/32/3762_2.png) [@Daniel\_Huang](https://dev.lucee.org/u/Daniel_Huang)\
**Post date:** [November 2, 2021, 11:12pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/9 "2021-11-02T23:12:06Z")

</div>

@cfmitrah Any advice on the above questions?

---

<div class="post-metadata">

**Author:** ![cfmitrah](https://dev.lucee.org/user_avatar/dev.lucee.org/cfmitrah/32/140_2.png) [@cfmitrah](https://dev.lucee.org/u/cfmitrah)\
**Post date:** [November 3, 2021, 8:28am UTC](https://dev.lucee.org/t/error-variable-structure/1673/10 "2021-11-03T08:28:19Z")

</div>

@Daniel_Huang Yes, cfcatch didn’t have those keys like the error variable. If you defined your custom error template in admin means use cferror tag in the application.cfc instead of that. Now you can use **error** variable with the above-mentioned keys in the error template.

```auto
<cferror type="request" template="/path-to-your/custom/errorTemplate.cfm"/>
<cferror type="exception" template="/path-to-your/custom/errorTemplate.cfm"/>

```

---

<div class="post-metadata">

**Author:** ![bdw429s](https://dev.lucee.org/user_avatar/dev.lucee.org/bdw429s/32/37_2.png) [@bdw429s](https://dev.lucee.org/u/bdw429s)\
**Post date:** [September 12, 2022, 10:23pm UTC](https://dev.lucee.org/t/error-variable-structure/1673/12 "2022-09-12T22:23:53Z")

</div>

> [@cfmitrah](#):
>
> Now you can use **error** variable with the above-mentioned keys in the error template.

@cfmitrah Are you saying that bug was fixed? Because this ticket is still marked as “Awaiting approval”  
[https://luceeserver.atlassian.net/browse/LDEV-3739](https://luceeserver.atlassian.net/browse/LDEV-3739)

Is there a duplicate that that needs linked?

---

<div class="post-metadata">

**Author:** ![cfmitrah](https://dev.lucee.org/user_avatar/dev.lucee.org/cfmitrah/32/140_2.png) [@cfmitrah](https://dev.lucee.org/u/cfmitrah)\
**Post date:** [September 13, 2022, 5:27am UTC](https://dev.lucee.org/t/error-variable-structure/1673/13 "2022-09-13T05:27:49Z")

</div>

No, That bug has not been fixed yet. I suggested the reporter to use cferror in the Application.cfc instead of defining an error template in the admin.
