MG Error Handling

28 views
Skip to first unread message

Douglas Trojanwoski

unread,
Sep 12, 2013, 3:05:25 PM9/12/13
to model...@googlegroups.com
Currently I have Error Handling like below but i was wondering how can i add variables/arguments form post to the below email. So if and error happens on a controller or cfc it would dump out all the agruments that were inputed. Same with something like a page so i can figure out and replicate what happened before i used <cfdump var="#arguments#"> or <cfdump var="#attributes#"> (old fusebox frame work) is there something i can set to get it to dump out variables?

<cfmail from="x...@xxx.com" subject="Error" to="x...@xxx.com"
            type="text/html">
   
        <p>
            Error For User:
            TEST
        </p>
        <p>
            Application: TEst
        </p>
        <table>
            <tr>
                <td valign="top">
                    <b>
                        Message
                    </b>
                </td>
                <td valign="top">
                    #exception.message#
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <b>
                        Detail
                    </b>
                </td>
                <td valign="top">
                    #exception.detail#
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <b>
                        Extended Info
                    </b>
                </td>
                <td valign="top">
                    #exception.ExtendedInfo#
                </td>
            </tr>
            <tr>
                <td valign="top">
                    <b>
                        Tag Context
                    </b>
                </td>
                <td valign="top">
                    <cfset tagCtxArr = exception.TagContext/>
                    <cfloop index="i" from="1" to="#ArrayLen(tagCtxArr)#">
                        <cfset tagCtx = tagCtxArr[i]/>
                        #tagCtx['template']#
                        (
                        #tagCtx['line']#
                        )
                        <br>
                    </cfloop>
                </td>
            </tr>
        </table>
         
    </cfmail>

Dan Wilson

unread,
Sep 12, 2013, 3:23:44 PM9/12/13
to model...@googlegroups.com
you could use event.getAll()

But a fair warning, it will get everything inside ModelGlue. Which could be quite a bit of stuff.

I usually dump out the CGI, Form, URL, Session

Thursday, September 12, 2013 3:05 PM
--
--
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
 
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to model...@googlegroups.com
To unsubscribe from this group, send email to
model-glue+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en
---
You received this message because you are subscribed to the Google Groups "model-glue" group.
To unsubscribe from this group and stop receiving emails from it, send an email to model-glue+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Douglas Trojanwoski

unread,
Sep 16, 2013, 7:45:14 AM9/16/13
to model...@googlegroups.com
Thanks, I guess i have a problem grasping getting varibles based on where the error occured.

so the view -> controller -> cfc that runs query in the model folder. so there places if the cfc fails i want to know what variables were pasted into it from the controller. if the controller failed i want to know what variables were passed to it from the view.

I see where the form scope might show me when an error will occur from view to controller. would arguments scope show me the arguments in a cfc if that fails?

Dan Wilson

unread,
Sep 16, 2013, 9:37:14 AM9/16/13
to model...@googlegroups.com
So, the process is:
User Initiates some action.
Action results in either FORM or URL parameters sent to /index.cfm
The value of the EVENT parameter determines which Model Glue event runs
The Model Glue event broadcasts messages
Zero or More controller functions are configured to listen to that message and do something
The Controller functions are passed the entire event object.
The Controller functions may pass all/some/none of the values to any number of Model objects.
The Controller functions may set all/some/none variables in the Event object
The Event configuration may execute Zero or More views.
The Views receive the entire event object.

So, in a  nutshell, the event object is the container where all of the state (Variables) is contained. Individual arguments are not passed to controller functions nor to view pages.

Model Glue does not manage your model objects and does not know what arguments are passed in there.


DW

Monday, September 16, 2013 7:45 AM
Thursday, September 12, 2013 3:23 PM

Brian G

unread,
Sep 18, 2013, 1:23:02 AM9/18/13
to model...@googlegroups.com

On Thursday, September 12, 2013 12:23:44 PM UTC-7, Dan Wilson - sipa...@gmail.com wrote:
you could use event.getAll()

But a fair warning, it will get everything inside ModelGlue. Which could be quite a bit of stuff.

I usually dump out the CGI, Form, URL, Session


I do similar.  You might also try fetching the event.getall() but looping over it and only displaying simple values if you want to avoid your email from being 100k lines long:

<cfset all = event.getAll()>
<cfloop array="all" index="item">
  <cfif isSimpleValue(item)>
    // do stuff
  </cfif>
</cfloop>


Reply all
Reply to author
Forward
0 new messages