Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Cannot catch error from SessionManagerAdobeHostedServices

Avatar

Level 2

I just got the following error in the client:

Error: error getting ticket: [Event type="error" bubbles=false cancelable=false eventPhase=2]
     at com.adobe.rtc.session.managers::SessionManagerAdobeHostedServices/onTicketError()
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at com.adobe.rtc.session.sessionClasses::SingleUseTicketService/sendRequest()
     at com.adobe.rtc.session.managers::SessionManagerAdobeHostedServices/onMeetingInfo()
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at com.adobe.rtc.session.sessionClasses::MeetingInfoService/onInfoReceive()
     at com.adobe.rtc.session.sessionClasses::MeetingInfoService/onComplete()
     at flash.events::EventDispatcher/dispatchEventFunction()
     at flash.events::EventDispatcher/dispatchEvent()
     at flash.net::URLLoader/onComplete()

It seems to come from (SessionManagerAdobeHostedServices)

          protected function onTicketError(p_evt:Event):void
          {
               throw new Error("error getting ticket: " + p_evt);
          }

Is there a way to catch errors in event listeneres? Otherwise it's not possible to handle this error gracefully. The global error handler could resolve it somewhen in the future but we cannot jump to 10.1 yet.

The root cause was on our server that most likely emitted an invalid authentication token, so that's not an issue anymore.

7 Replies

Avatar

Former Community Member

Hi Mark,

If you are linking to the source files and not using swc, you can do these changes for yourself in source code of LCCS.

To catch this error as an event rather than throwing as we do by default, you can do something like

var p_error:Object = new Object();

p_error.name = "Give it a name" ;

p_error.message = "Send the message" ;

super.receiveError(p_errorObject);

inside your onTicketError function.

Just look at the code inside onSessionError function in SessionManagerAdobeHostedServices. It works similarly. This error object that you created gets converted into an event called SessionEvent.ERROR ( look at the code inside SessionManagerBase's onSessionError). SessionManagerBase is the base class for SessionManagerAdobeHostedServices.

Finally, since this event is thrown by SessionManagerBase, the connectSession catches it automatically. So, all you need to do is add a event listener to connectionSession to catch this error(look at onSessionError function inside ConnectSession.as ). And you should be able to handle this.

I haven't tried it but rather throwing you an idea. So, give it a shot.

Hope this helps

Thanks

Hironmay Basu

Avatar

Level 2

Hi Hironmay,

Thanks for the tip, I fixed it with receiveError(). I also hope that it gets

fixed in the next release

Marc

Avatar

Former Community Member

Hi Mark,

We are not sure whether we will change that or keep that ticketing error and let any user do customizations. However, we will definitely deliberate over it and if it's going in, I will let you know.

Thanks

Hironmay Basu

Avatar

Level 2

Hi Hironmay,

Throwing an error that cannot be handled by custom code is in my opionen a

mistake. It means that the end user might see a strange message to him. So I

strongly vote for a change.

Thank's for your work anyway,

Marc

Avatar

Former Community Member

I'm with Marc on this one. Throwing an error that can't be listened to (short of a global error handler) seems like bad practice.

(We just encountered a similar error and I found this forum thread while Googling for causes.)

Avatar

Former Community Member

Hi Brian,

The issue in this case is that because what is happening is asynchronous,

there's seriously no way to give you the opportunity to catch the error.

For errors in the Session subsystem, what's supposed to be happening (and I

see that it isn't - grrr!) is that if you're listening for SessionEvents in

the IConnectSession, you should be getting events rather than errors. If

you're not listening for those events, THEN you'd get an error.

Not sure how this one got past Basu either. We've just checked in a fix

that should arrive in the next SDK release (weeks, not months). For now, an

easy patch is to replace SessionManagerAdobeHostedServices.onTicketError's

contents with a one liner :

receiveError();

hope that helps, and thanks for the report!

nigel

Avatar

Former Community Member

Right, I was just not suggesting we could "catch" it so much as listen for it (in an error-Event).

In either case, glad to see it's on the radar for a short-term fix. That's awesome. Thanks for the update, Nigel.