PDA

View Full Version : File Upload form, handling service unavailable



noosy
24 Oct 2011, 9:50 PM
Guys,

Testing error handling on my file upload form and currently when my service is unavailable I see a 500 HTTP status code in Firebug and this is the server response:

<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> <title>Error 500 BeanFactory not initialized or already closed - call 'refresh' before accessing beans via the ApplicationContext</title> </head> <body><h2>HTTP ERROR 500</h2>
...

This also is seen as a Network error in the console.

Followed by:

uncaught exception: You're trying to decode an invalid JSON String: <h2>HTTP ERROR 500</h2> <p>Problem accessing /cxf/pathTo/MyService/. Reason:
...

How can I gracefully handle this?

With my own server side exceptions I am catching them and reformatting as JSON and sending it back as a string with success:false.

Hope somebody can help. Thanks!