• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Identifying specific errors

New Here ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

Greetings,

I would like to be able to handle some specific errors without having th script abort. For example, I have a form that allows users to upload a file and enter information about the file into a table. So when it comes to actually uploading the file, I can set an accept string to say Image/* to only allow images. If the user uploads a text file, the script aborts with a message. But I would prefer to output a message and return to the form, retaining the data entered.

I can trap application errors, but I would really only like to look at this particular error. I see embedded in the CFCATCH structure the string "$InvalidUploadTypeException". Is there a list of such exception strings? Is there a place to find this without searching through the CFCATCH structure?

Thanks for your help.

Larry
TOPICS
Advanced techniques

Views

546

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Jan 23, 2007 Jan 23, 2007
quote:

Originally posted by: NoonEclipse
I can trap application errors, but I would really only like to look at this particular error. I see embedded in the CFCATCH structure the string "$InvalidUploadTypeException". Is there a list of such exception strings? Is there a place to find this without searching through the CFCATCH structure?

Thanks for your help.

Larry


There is no list of exceptions and such a list would change with every release or patch (still would be good if Adobe publish...

Votes

Translate

Translate
LEGEND ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

javascript window.history.back(1) or whatever the proper syntax is often brings them with the form values in place,

The other alternative is to store all the form variables as session variables and repopulate the form after you send the user back.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

quote:

Originally posted by: NoonEclipse
I can trap application errors, but I would really only like to look at this particular error. I see embedded in the CFCATCH structure the string "$InvalidUploadTypeException". Is there a list of such exception strings? Is there a place to find this without searching through the CFCATCH structure?

Thanks for your help.

Larry


There is no list of exceptions and such a list would change with every release or patch (still would be good if Adobe published the list).

Yes, you must dive through the catch info, as sucky as that may be. There is no other ¿legal? way to get a list of exception types and there are at least 800 (roughly) possible exceptions as of CF 7.02.

You might be alert for such things as:
quote:

CFFileNonMultipartException
CouldNotDeleteFileException
DirectoryIsFileException
DirFileIsReadOnlyException
DocumentFileExistsException
EmptyFileUploadException
FileCharConversionException
FileDeleteFailedException
FileNotFoundException
FileOverwriteException
FilePermissionException
FormFileNotFoundException
InvalidArchiveFileException
InvalidCFFileActionException
InvalidFileAttributeException
InvalidFileFilterException
InvalidUploadTypeException
MultipleFileOperationException
SingleFileOperationException



But you didn't hear that from me! ;-)

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

Thanks MikerRoo,

I appreciate the info, although I am surprised that there isn't a better way. Most other languages make it simple and give you an error code or status code. Strange that ColdFusion does not.

How did you generate this list? Other than creating every error and seeing what popped up?

I appreciate the help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

BTW, there is a little help at:
http://livedocs.macromedia.com/coldfusion/7/htmldocs/00000225.htm

As for that list, alas, I'm not allowed to say where I got it (damn lawyers) and there is nothing but names. You have to imagine what might trigger each.

Adobe would be wise to keep a current list in live docs (except for MAYBE any "sensitive" items**). It would help them and it would help us.

** Of course, if such items came up in an error dump, they would eventually be revealed and probably first to the very worst eyes (hackers and competitors are the best at ferreting out such info).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 23, 2007 Jan 23, 2007

Copy link to clipboard

Copied

Amazing. Now why would hiding error information be a security problem? All of this is on the error page anyway, so they can be figured out. IF you want to wast the time doing it, and assuming that all of the strings relate to something meaningful.

I wonder if someone is just trying to protect their job? (If I don't tell people what the errors are they have to keep coming to me...) On the other hand, maybe they just don't want to make if easier for developers.

If I get fed up enough I will just move to another platform that does make such things easy.

Thanks for your sharing your knowledge.

Larry

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2007 Jan 24, 2007

Copy link to clipboard

Copied

> Adobe would be wise to keep a current list in live docs (except for MAYBE any
> "sensitive" items**). It would help them and it would help us.

The CFMX8 beta is coming up. Get onto it, and make a feature request. Or
remind me in a couple of weeks and I'll do it. It's a good suggestion.

(Perhaps best to submit a standard feature request now...)

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 24, 2007 Jan 24, 2007

Copy link to clipboard

Copied

I have requested this feature. It was amazingly difficult to find where to do it, but I persevered and managed to do it.

Thanks for the suggestion Adam.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 24, 2007 Jan 24, 2007

Copy link to clipboard

Copied

LATEST
> I have requested this feature. It was amazingly difficult to find where to do it, but I persevered and managed to do it.
> Thanks for the suggestion Adam.

I'll keep an eye out for it on the beta...

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation