We help IT Professionals succeed at work.
Get Started

Try/Catch in ColdFusion

hefterr asked
Last Modified: 2013-12-24
I'm a little new to Coldfusion so I could use a little help with catching errors.

I have a program the is invoked from an email link to activate an account.  It has a statement to decrypt a URL variable :

<CFSET account = decrypt(toString(toBinary(url.encrypted)),application.seed)>
<cfif account eq table.account>
  {do some updating}

The problem is that if the user cuts/pastes only part of the encrypted URL, the CF decryption fails and goes to a general ColdFusion error screen.

I would like to catch this error and return my own page.

I've never worked with try/catch so could someone sketch the structure for me?

Thanks in advance,
Watch Question
This problem has been solved!
Unlock 2 Answers and 2 Comments.
See Answers
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE