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

Coldfusion and Flex Error Handling

Guest
May 19, 2009 May 19, 2009

Hello! I was wondering if someone could point me in the right direction regarding error handling in a Flex app thats using an HTTPSERVICE RPC to a Coldfusion component.

If a user is entering form data in Flex and clicks submit... the data is sent via the HTTPSERVICE send method as XML to the CFC. But what if there is a Coldfusion SQL insert statement error? Say a user enters a character in a number field (now i know the best thing to do would be to have actionscript ensure that the values entered are numbers but lets keep that aside just for this example). How could I alert the user to let them know the CFC encountered a SQL error? Or better yet... alert them that everything went "A" ok and their data was successfully submitted.

I originally thought to put CFTRY and CFCATCH around the CFC code. I could do that fine, but had trouble passing back a message string so that FLEX could use it in an Alert.Show window.

Thanks!

-BosDog

TOPICS
Flash integration
1.5K
Translate
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
Guest
Sep 12, 2009 Sep 12, 2009
LATEST

Flex can use the errors thrown by CFTHROW.  If your cfc is using cfscript and CF9 you can now just use Throw();

One note though.  This is how I throw back errors to Flex when I am using Remote Objects.  Not sure if it handles it the same way with HTTPService.  But I assume that it would be very similar.

-Joe

Translate
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