Results 1 to 3 of 3

Thread: XMLApplicationContext errorhandler

  1. #1
    Join Date
    Apr 2011
    Posts
    10

    Default XMLApplicationContext errorhandler

    Hello,

    I have a small problem with my mobile application. When the user want's to logon he can connect with a server. For this I use this code:

    Code:
    private var m_context:XMLApplicationContext;
    
    public function execute():*
    		{
    			m_context = new XMLApplicationContext("application-context.xml");
    			m_context.addConfigLocation("application-context-services.xml");
    			m_context.addEventListener(Event.COMPLETE, onComplete);
    			m_context.load(); 
    			ServiceLocator.getInstance().context = m_context;
    		}
    Now my problem is when the server he want's to connect to is wrong or he can't connect I would like to add a popup then saying this. But I can't add an ErrorListner to m_context or an eventlistner to detect when he can't connect.

    Thanks in advance.

    Kind regards,

    Thibault Heylen

  2. #2
    Join Date
    Dec 2008
    Location
    Brussels
    Posts
    407

    Default not yet

    Hey there,

    at the moment the context doesn't dispatch an error event, I'm pretty sure an exception is thrown whenever the XML can't be loaded.
    For the moment I would wrap the context loading code in a try/catch block and show the Alert in the catch.

    Perhaps you can also add a feature request in JIRA for some more appropriate error events in the context:

    https://jira.springsource.org/browse...ACTIONSCRIPTAS

    cheers,

    Roland

  3. #3
    Join Date
    Apr 2011
    Posts
    10

    Default

    Thanks I fixed it!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •