added handling to application errors thrown at server side.
Authored by: SeanZ 2011-07-08
Parent: [r5419]
Child: [r5421]