flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/5] git commit: [flex-utilities] [refs/heads/develop] - add uncaught error handler. Also don't allow caching if no folder specified
Date Fri, 13 Jun 2014 19:40:13 GMT
Repository: flex-utilities
Updated Branches:
  refs/heads/develop 6ce4b8370 -> 9dfc183a9


add uncaught error handler.  Also don't allow caching if no folder specified


Project: http://git-wip-us.apache.org/repos/asf/flex-utilities/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-utilities/commit/104e157d
Tree: http://git-wip-us.apache.org/repos/asf/flex-utilities/tree/104e157d
Diff: http://git-wip-us.apache.org/repos/asf/flex-utilities/diff/104e157d

Branch: refs/heads/develop
Commit: 104e157d61fc23431904ac16bdee877baa0a23f5
Parents: 6ce4b83
Author: Alex Harui <aharui@apache.org>
Authored: Thu Jun 12 09:41:26 2014 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Jun 12 09:41:26 2014 -0700

----------------------------------------------------------------------
 installer/src/InstallApacheFlex.mxml | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-utilities/blob/104e157d/installer/src/InstallApacheFlex.mxml
----------------------------------------------------------------------
diff --git a/installer/src/InstallApacheFlex.mxml b/installer/src/InstallApacheFlex.mxml
index b055fc3..8971415 100644
--- a/installer/src/InstallApacheFlex.mxml
+++ b/installer/src/InstallApacheFlex.mxml
@@ -91,7 +91,7 @@ variables are not required because the locations of these pieces are known.
                         <s:Button label="Browse..." click="browseFolders()" styleName="genericBtnStyle"
enabled="{cb.selected}"/>
                     </s:HGroup>
                     <s:HGroup horizontalAlign="center" width="100%" >
-                        <s:Button label="OK" click="updateCache()" styleName="genericBtnStyle"
/>
+                        <s:Button label="OK" click="updateCache()" enabled="{cb.selected
== false || folder.text.length > 0}" styleName="genericBtnStyle" />
                         <s:Button label="Cancel" click="closeUp()" styleName="genericBtnStyle"
/>
                     </s:HGroup>
                 </s:VGroup>
@@ -381,11 +381,37 @@ variables are not required because the locations of these pieces are
known.
 		
 		protected function handleApplicationComplete(event:FlexEvent):void {
             CursorManager.setBusyCursor();
+			loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, uncaughtErrorHandler);
             updateWindow();
 			loadXML();
             logVersion();
 		}
 		
+		private function uncaughtErrorHandler(event:UncaughtErrorEvent):void
+		{
+			if (currentStep > 0)
+				updateActivityStep(stepLabels[currentStep - 1], StepItem.ERROR);
+			if (event.error is Error)
+			{
+				var error:Error = event.error as Error;
+				log(error.message);
+				log(error.getStackTrace(), -1, false);
+				abortInstallation(error.message + "\n" + error.getStackTrace());
+			}
+			else if (event.error is ErrorEvent)
+			{
+				var errorEvent:ErrorEvent = event.error as ErrorEvent;
+				log(errorEvent.text);
+				abortInstallation(errorEvent.text);
+			}
+			else
+			{
+				// a non-Error, non-ErrorEvent type was thrown and uncaught
+				log(event.toString());
+				abortInstallation(event.toString());
+			}
+		}
+
 		/**
 		 * Define on ResourceManager all keys for translation.
 		 * If some key is not present on any other language selected by user, the default value
will be displayed


Mime
View raw message