Skip to main content
Inspiring
March 19, 2024
Question

How to Output Error Message to page

  • March 19, 2024
  • 1 reply
  • 366 views

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 has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    March 20, 2024

    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>
    Legend
    March 20, 2024

    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.