Skip to main content
Inspiring
Mar 19, 2024 10:35 AM UTC
Question

How to Output Error Message to page

I have a server with hard to access error logs.

 

I keep getting an error on a certain page.

 

Is there a way for me to output the error to the page, instead of just seeing the generic 500 error message?

500 - Internal server error.

There is a problem with the resource you are looking for, and it cannot be displayed.

    This topic is closed to new replies. Start a new post to keep the conversation going.

    2 replies

    BKBK
    Community Expert
    Community Expert
    Mar 20, 2024 2:55 PM UTC

    An "internal server error" means just that. The error occurs at the level of the server, not at the level of code. Unless the code is server-related.

     

    What do the log files coldfusion-out.log, coldfusion-error.log and server.log say? If the error is triggered by server-related code, a try/catch might provide more information:

    <cfscript>
    	try {
        	// bothersome code
    	}
    	catch (any e) {
    	    writedump(var=e, label="Exception");
    	}
    </cfscript>
    Translate
    Legend
    Mar 20, 2024 3:04 PM UTC

    BKBK's suggestion is the method we use most of the time, as well, in cases like this.  In some situations, where you don't want to potentially show the users the contents of an error message,  (continuing to use BKBK's method) you can put the DUMP into a CFMAIL and email the error to yourself.

    Translate