 
 		@isAuthorisationErrorPage: (contents) ->
 			/https?:\/\/www\.google\.com\/accounts\/OAuthAuthorizeToken/i.test contents
+
+		@isAuthorisationErrorResponse: (resp) ->
+			resp?.toLowerCase().indexOf "authorization" isnt -1
 
 		checkAuthorised: (resp) ->
 			url = @getServiceURL()

					title: 		__msg 'notificationScheduleSuccessTitle'
					message: 	__msg 'notificationScheduleSuccess'
			else
				@onScheduleError data.error, null, data.error
			return

		createDialog: (title, okButton, cancelButton) ->


		onScheduleError: (status, params, error, responseText) =>
			log 'There was an error', arguments
			if (status is 'parsererror' and M.isAuthorisationErrorPage responseText) or (M.isAuthorisationErrorResponse status)
				params ?= {}
				params.action = 'setup'
				delete params.callback if params.callback
				@gettingStarted params
