catch any exceptions from sugarjs not working correctly